Sha256: 3cdc65adf0632196e3acb1979ac4b902a5b19dc9c3cadb9b490ee1a9fc6d88f8

Contents?: true

Size: 1.31 KB

Versions: 38

Compression:

Stored size: 1.31 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require 'cucumber/wire_support/wire_language'
require 'tempfile'

module Cucumber
  module WireSupport
    describe Configuration do
      let(:wire_file) { Tempfile.new('wire') }
      let(:config) { Configuration.new(wire_file.path) }
      
      def write_wire_file(contents)
        wire_file << contents
        wire_file.close
      end
      
      it "reads the hostname / port from the file" do
        write_wire_file %q{
          host: localhost
          port: 54321
        }
        config.host.should == 'localhost'
        config.port.should == 54321
      end
      
      it "reads the timeout for a specific message" do
        write_wire_file %q{
          host: localhost
          port: 54321
          timeout:
            invoke: 99
        }
        config.timeout('invoke').should == 99
      end
      
      describe "a wire file with no timeouts specified" do
        before(:each) do
          write_wire_file %q{
            host: localhost
            port: 54321
          }
        end
        
        %w(invoke begin_scenario end_scenario).each do |message|
          it "sets the default timeout for '#{message}' to 120 seconds" do
            config.timeout(message).should == 120
          end
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 3 rubygems

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