spec/cucumber/cli/profile_loader_spec.rb in cucumber-1.3.20 vs spec/cucumber/cli/profile_loader_spec.rb in cucumber-2.0.0.beta.1

- old
+ new

@@ -3,33 +3,34 @@ module Cucumber module Cli describe ProfileLoader do def given_cucumber_yml_defined_as(hash_or_string) - Dir.stub(:glob).with('{,.config/,config/}cucumber{.yml,.yaml}').and_return(['cucumber.yml']) - File.stub(:exist?).and_return(true) + allow(Dir).to receive(:glob).with('{,.config/,config/}cucumber{.yml,.yaml}') { ['cucumber.yml'] } + allow(File).to receive(:exist?) { true } + cucumber_yml = hash_or_string.is_a?(Hash) ? hash_or_string.to_yaml : hash_or_string - IO.stub(:read).with('cucumber.yml').and_return(cucumber_yml) + + allow(IO).to receive(:read).with('cucumber.yml') { cucumber_yml } end def loader ProfileLoader.new end it "treats backslashes as literals in rerun.txt when on Windows (JRuby or MRI)" do given_cucumber_yml_defined_as({'default' => '--format "pretty" features\sync_imap_mailbox.feature:16:22'}) if(Cucumber::WINDOWS) - loader.args_from('default').should == ['--format','pretty','features\sync_imap_mailbox.feature:16:22'] + expect(loader.args_from('default')).to eq ['--format','pretty','features\sync_imap_mailbox.feature:16:22'] else - loader.args_from('default').should == ['--format','pretty','featuressync_imap_mailbox.feature:16:22'] + expect(loader.args_from('default')).to eq ['--format','pretty','featuressync_imap_mailbox.feature:16:22'] end - end it "treats forward slashes as literals" do given_cucumber_yml_defined_as({'default' => '--format "ugly" features/sync_imap_mailbox.feature:16:22'}) - loader.args_from('default').should == ['--format','ugly','features/sync_imap_mailbox.feature:16:22'] - end + expect(loader.args_from('default')).to eq ['--format','ugly','features/sync_imap_mailbox.feature:16:22'] + end end end end