From 2d636406dc7db6e30accac1bd5d46e8962a26997 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 13 Apr 2017 17:24:58 -0400 Subject: [PATCH] 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 --- lib/autospec/simple_runner.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/autospec/simple_runner.rb b/lib/autospec/simple_runner.rb index e94d3d93413..be8da854c79 100644 --- a/lib/autospec/simple_runner.rb +++ b/lib/autospec/simple_runner.rb @@ -7,14 +7,16 @@ module Autospec def run(specs) puts "Running Rspec: " << specs # kill previous rspec instance - abort + self.abort # we use our custom rspec formatter args = ["-r", "#{File.dirname(__FILE__)}/formatter.rb", "-f", "Autospec::Formatter", specs.split].flatten.join(" ") # launch rspec - @pid = Process.spawn({"RAILS_ENV" => "test"}, "bundle exec rspec #{args}") - _, status = Process.wait2(@pid) - status.exitstatus + Dir.chdir(Rails.root) do + @pid = Process.spawn({"RAILS_ENV" => "test"}, "bin/rspec #{args}") + _, status = Process.wait2(@pid) + status.exitstatus + end end def abort