From 2063b39a563829aeb794d5a8b508e5b20e586096 Mon Sep 17 00:00:00 2001 From: Jean Mertz Date: Mon, 1 Apr 2013 17:10:48 +0300 Subject: [PATCH 1/2] Don't require Bundler to use binstubs --- lib/guard/cucumber/runner.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/guard/cucumber/runner.rb b/lib/guard/cucumber/runner.rb index 69e55d6..8214bc1 100644 --- a/lib/guard/cucumber/runner.rb +++ b/lib/guard/cucumber/runner.rb @@ -44,7 +44,7 @@ def cucumber_command(paths, options) cmd = [] cmd << options[:command_prefix] if options[:command_prefix] cmd << "rvm #{ options[:rvm].join(',') } exec" if options[:rvm].is_a?(Array) - cmd << 'bundle exec' if (bundler? && options[:bundler] != false) || (bundler? && options[:binstubs].is_a?(TrueClass)) + cmd << 'bundle exec' if bundler? && options[:bundler] != false cmd << cucumber_exec(options) cmd << options[:cli] if options[:cli] @@ -64,7 +64,7 @@ def cucumber_command(paths, options) # @return [String] Cucumber executable # def cucumber_exec(options = {}) - options[:binstubs] == true && ( bundler? || options[:bundler] != false ) ? 'bin/cucumber' : 'cucumber' + options[:binstubs] == true ? 'bin/cucumber' : 'cucumber' end # Simple test if bundler should be used. it just checks for the `Gemfile`. From 96bbb4e2d7a3082fa8e86281abf25a15b7c93308 Mon Sep 17 00:00:00 2001 From: Jean Mertz Date: Mon, 1 Apr 2013 17:27:54 +0300 Subject: [PATCH 2/2] pass tests: 'bundler false and binstubs true' --- spec/guard/cucumber/runner_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/guard/cucumber/runner_spec.rb b/spec/guard/cucumber/runner_spec.rb index dd94510..e167fa4 100644 --- a/spec/guard/cucumber/runner_spec.rb +++ b/spec/guard/cucumber/runner_spec.rb @@ -82,7 +82,7 @@ describe ':binstubs' do it 'runs without Bundler with binstubs option to true and bundler option to false' do subject.should_receive(:system).with( - "bundle exec bin/cucumber --require #{ @lib_path.join('guard/cucumber/notification_formatter.rb') } --format Guard::Cucumber::NotificationFormatter --out #{ null_device } --require features features" + "bin/cucumber --require #{ @lib_path.join('guard/cucumber/notification_formatter.rb') } --format Guard::Cucumber::NotificationFormatter --out #{ null_device } --require features features" ).and_return(true) subject.run(['features'], :bundler => false, :binstubs => true) end