Sha256: 16a138c7e1d203d6094fa7ac94212452fb4fe7567d41ef12e75c555cb7fbf173

Contents?: true

Size: 1.29 KB

Versions: 45

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

45 entries across 43 versions & 9 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/cli/profile_loader_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/cli/profile_loader_spec.rb
candlepin-api-0.4.0 bundle/ruby/gems/cucumber-1.2.1/spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.2 spec/cucumber/cli/profile_loader_spec.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.1 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.3.0 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.2.5 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.2.3 spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.2.2 spec/cucumber/cli/profile_loader_spec.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/cli/profile_loader_spec.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/cli/profile_loader_spec.rb
casecumber-1.0.2.1 spec/cucumber/cli/profile_loader_spec.rb
casecumber-1.2.1.cb2 spec/cucumber/cli/profile_loader_spec.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.2.1 spec/cucumber/cli/profile_loader_spec.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/cli/profile_loader_spec.rb
ftl-0.2.0 vendor/bundle/gems/cucumber-1.2.0/spec/cucumber/cli/profile_loader_spec.rb
cucumber-1.2.0 spec/cucumber/cli/profile_loader_spec.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/cli/profile_loader_spec.rb