mirror of
https://github.com/discourse/discourse.git
synced 2025-07-14 01:10:53 +08:00
FIX: in some case bundle exec fails from spawn
there is some bundler magic in here, prefer bin stubs anyway cause they are a bit faster
This commit is contained in:
@ -7,14 +7,16 @@ module Autospec
|
|||||||
def run(specs)
|
def run(specs)
|
||||||
puts "Running Rspec: " << specs
|
puts "Running Rspec: " << specs
|
||||||
# kill previous rspec instance
|
# kill previous rspec instance
|
||||||
abort
|
self.abort
|
||||||
# we use our custom rspec formatter
|
# we use our custom rspec formatter
|
||||||
args = ["-r", "#{File.dirname(__FILE__)}/formatter.rb",
|
args = ["-r", "#{File.dirname(__FILE__)}/formatter.rb",
|
||||||
"-f", "Autospec::Formatter", specs.split].flatten.join(" ")
|
"-f", "Autospec::Formatter", specs.split].flatten.join(" ")
|
||||||
# launch rspec
|
# launch rspec
|
||||||
@pid = Process.spawn({"RAILS_ENV" => "test"}, "bundle exec rspec #{args}")
|
Dir.chdir(Rails.root) do
|
||||||
_, status = Process.wait2(@pid)
|
@pid = Process.spawn({"RAILS_ENV" => "test"}, "bin/rspec #{args}")
|
||||||
status.exitstatus
|
_, status = Process.wait2(@pid)
|
||||||
|
status.exitstatus
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def abort
|
def abort
|
||||||
|
Reference in New Issue
Block a user