Sha256: ad39f88212bdcb7f21bee228920ad1a76d8d3ed8c6e418464780fc367b9aee44

Contents?: true

Size: 1.46 KB

Versions: 19

Compression:

Stored size: 1.46 KB

Contents

require 'cucumber/wire/configuration'
require 'tempfile'

module Cucumber
  module Wire
    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
        }

        expect(config.host).to eq 'localhost'
        expect(config.port).to eq 54321
      end

      it "reads the timeout for a specific message" do
        write_wire_file %q{
          host: localhost
          port: 54321
          timeout:
            invoke: 99
        }

        expect(config.timeout('invoke')).to eq 99
      end

      it "reads the timeout for a connect message" do
        write_wire_file %q{
          host: localhost
          port: 54321
          timeout:
            connect: 99
        }

        expect(config.timeout('connect')).to eq 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
            expect(config.timeout(message)).to eq 120
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
cucumber-wire-6.2.1 spec/cucumber/wire/configuration_spec.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/cucumber-wire-6.2.0/spec/cucumber/wire/configuration_spec.rb
cucumber-wire-6.2.0 spec/cucumber/wire/configuration_spec.rb
cucumber-wire-6.1.1 spec/cucumber/wire/configuration_spec.rb
cucumber-wire-6.1.0 spec/cucumber/wire/configuration_spec.rb
cucumber-wire-6.0.1 spec/cucumber/wire/configuration_spec.rb
cucumber-wire-6.0.0 spec/cucumber/wire/configuration_spec.rb
cucumber-wire-5.0.1 spec/cucumber/wire/configuration_spec.rb
cucumber-wire-5.0.0 spec/cucumber/wire/configuration_spec.rb
cucumber-wire-4.0.1 spec/cucumber/wire/configuration_spec.rb
cucumber-wire-3.1.0 spec/cucumber/wire/configuration_spec.rb
cucumber-wire-3.0.0 spec/cucumber/wire/configuration_spec.rb
cucumber-wire-2.0.1 spec/cucumber/wire/configuration_spec.rb
cucumber-wire-2.0.0 spec/cucumber/wire/configuration_spec.rb
cucumber-wire-1.2.0 spec/cucumber/wire/configuration_spec.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/cucumber-wire-0.0.1/spec/cucumber/wire/configuration_spec.rb
cucumber-wire-1.1.0 spec/cucumber/wire/configuration_spec.rb
cucumber-wire-1.0.0 spec/cucumber/wire/configuration_spec.rb
cucumber-wire-0.0.1 spec/cucumber/wire/configuration_spec.rb