Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix tests

  • Loading branch information...
commit e4dcb262a80c3d9e3c3642d11bdad2d5886e931b 1 parent 7334e7d
@grosser authored
View
3  lib/parallel_tests/cucumber/runner.rb
@@ -71,8 +71,9 @@ def self.cucumber_opts(given)
end
def self.profile_from_config
+ # copied from https://github.com/cucumber/cucumber/blob/master/lib/cucumber/cli/profile_loader.rb#L85
config = Dir.glob('{,.config/,config/}cucumber{.yml,.yaml}').first
- if File.exists?(config) && File.read(config) =~ /^parallel:/
+ if config && File.read(config) =~ /^parallel:/
"--profile parallel"
end
end
View
6 spec/parallel_tests/cucumber/runner_spec.rb
@@ -56,7 +56,7 @@ def call(*args)
context "with parallel profile in config/cucumber.yml" do
before do
file_contents = 'parallel: -f progress'
- File.stub(:exists?).with('config/cucumber.yml').and_return true
+ Dir.stub(:glob).and_return ['config/cucumber.yml']
File.stub(:read).with('config/cucumber.yml').and_return file_contents
end
@@ -79,14 +79,14 @@ def call(*args)
it "does not use parallel profile if config/cucumber.yml does not contain it" do
file_contents = 'blob: -f progress'
ParallelTests::Cucumber::Runner.should_receive(:open).with{|x,y| x =~ %r{script/cucumber .* foo bar}}.and_return mocked_process
- File.should_receive(:exists?).with('config/cucumber.yml').and_return true
+ Dir.should_receive(:glob).and_return ['config/cucumber.yml']
File.should_receive(:read).with('config/cucumber.yml').and_return file_contents
call(['xxx'],1,:test_options => 'foo bar')
end
it "does not use the parallel profile if config/cucumber.yml does not exist" do
ParallelTests::Cucumber::Runner.should_receive(:open).with{|x,y| x =~ %r{script/cucumber .*}}.and_return mocked_process
- File.should_receive(:exists?).with('config/cucumber.yml').and_return false
+ Dir.should_receive(:glob).and_return []
call(['xxx'],1,{})
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.