Sha256: 33660d8d4e3db0f161ab7002bd2460c462f43887063f5b36856cf6c5bac1b07f

Contents?: true

Size: 1.34 KB

Versions: 37

Compression:

Stored size: 1.34 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../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

37 entries across 37 versions & 3 rubygems

Version Path
cucumber-0.8.7 spec/cucumber/cli/profile_loader_spec.rb
cucumber-0.10.7 spec/cucumber/cli/profile_loader_spec.rb
cucumber-0.10.6 spec/cucumber/cli/profile_loader_spec.rb
cucumber-0.10.5 spec/cucumber/cli/profile_loader_spec.rb
cucumber-0.10.3 spec/cucumber/cli/profile_loader_spec.rb
cucumber-0.10.2 spec/cucumber/cli/profile_loader_spec.rb
cucumber-0.10.1 spec/cucumber/cli/profile_loader_spec.rb
stefl-cucumber-0.10.1 spec/cucumber/cli/profile_loader_spec.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/cucumber-0.9.4/spec/cucumber/cli/profile_loader_spec.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/cucumber-0.9.4/spec/cucumber/cli/profile_loader_spec.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/cucumber-0.9.4/spec/cucumber/cli/profile_loader_spec.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/cucumber-0.9.4/spec/cucumber/cli/profile_loader_spec.rb
cucumber-0.10.0 spec/cucumber/cli/profile_loader_spec.rb
cucumber-0.9.4 spec/cucumber/cli/profile_loader_spec.rb
cucumber-0.9.3 spec/cucumber/cli/profile_loader_spec.rb
cucumber-0.9.2 spec/cucumber/cli/profile_loader_spec.rb
cucumber-0.9.1 spec/cucumber/cli/profile_loader_spec.rb
cucumber-0.9.0 spec/cucumber/cli/profile_loader_spec.rb
cucumber-0.8.5 spec/cucumber/cli/profile_loader_spec.rb
cucumber-0.8.4 spec/cucumber/cli/profile_loader_spec.rb