diff --git a/lib/cucumber/rake/task.rb b/lib/cucumber/rake/task.rb index 6596c7f99c..23202c1ff6 100644 --- a/lib/cucumber/rake/task.rb +++ b/lib/cucumber/rake/task.rb @@ -92,7 +92,8 @@ def gem_available_new_rubygems?(gemname) def cmd if use_bundler - [ Cucumber::RUBY_BINARY, '-S', 'bundle', 'exec', 'cucumber', @cucumber_opts, + bundle_cmd = Gem.default_exec_format % 'bundle' + [ Cucumber::RUBY_BINARY, '-S', bundle_cmd, 'exec', 'cucumber', @cucumber_opts, @feature_files ].flatten else [ Cucumber::RUBY_BINARY, '-I', load_path(@libs), quoted_binary(@cucumber_bin), diff --git a/spec/cucumber/rake/forked_spec.rb b/spec/cucumber/rake/forked_spec.rb index 86ff45e685..5307a198e7 100644 --- a/spec/cucumber/rake/forked_spec.rb +++ b/spec/cucumber/rake/forked_spec.rb @@ -24,9 +24,22 @@ module Rake end it "uses bundle exec to find cucumber and libraries" do + bundle_cmd = Gem.default_exec_format % 'bundle' + + subject.cmd.should == [Cucumber::RUBY_BINARY, + '-S', + bundle_cmd, + 'exec', + 'cucumber', + '--cuke-option'] + feature_files + end + + it "obeys program suffix for bundler" do + Gem::ConfigMap.stub(:[]).with(:ruby_install_name).and_return('XrubyY') + subject.cmd.should == [Cucumber::RUBY_BINARY, '-S', - 'bundle', + 'XbundleY', 'exec', 'cucumber', '--cuke-option'] + feature_files @@ -59,4 +72,4 @@ module Rake end end -end \ No newline at end of file +end