Sha256: 4b1eacc28fb7ac6c7d2662a64bbf907e129fe7eba2a3f55078b731170720b146

Contents?: true

Size: 1.48 KB

Versions: 26

Compression:

Stored size: 1.48 KB

Contents

require '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.from_file(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

      it "reads the timeout for a connect message" do
        write_wire_file %q{
          host: localhost
          port: 54321
          timeout:
            connect: 99
        }
        config.timeout('connect').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

26 entries across 24 versions & 2 rubygems

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