Sha256: eae408334dc360624429ece45457a9df430abb212bbe0364b29d725a7ec0b24b

Contents?: true

Size: 1.29 KB

Versions: 21

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'
require 'yaml'

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)
        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)
      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']
        else
          loader.args_from('default').should == ['--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

    end
  end
end

Version data entries

21 entries across 19 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/cucumber-1.3.18/spec/cucumber/cli/profile_loader_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/cucumber-1.3.16/spec/cucumber/cli/profile_loader_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/cucumber-1.3.18/spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.20 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.19 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.18 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.17 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.16 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.15 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.14 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.13 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.12 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.11 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.10 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.9 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.8 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.7 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.6 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.5 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.4 spec/cucumber/cli/profile_loader_spec.rb