Sha256: f1de1869062548f9e4331d3e63f6c5908f65c3f2f7a1b93cb424104bdfd57a59
Contents?: true
Size: 829 Bytes
Versions: 40
Compression:
Stored size: 829 Bytes
Contents
require 'yaml' require 'erb' module Cucumber module WireSupport class Configuration attr_reader :host, :port, :unix def self.from_file(wire_file) settings = YAML.load(ERB.new(File.read(wire_file)).result) new(settings) end def initialize(args) @host = args['host'] @port = args['port'] @unix = args['unix'] if RUBY_PLATFORM !~ /mingw|mswin/ @timeouts = DEFAULT_TIMEOUTS.merge(args['timeout'] || {}) end def timeout(message = nil) return @timeouts[message.to_s] || 3 end def to_s return @unix if @unix "#{@host}:#{@port}" end DEFAULT_TIMEOUTS = { 'connect' => 11, 'invoke' => 120, 'begin_scenario' => 120, 'end_scenario' => 120 } end end end
Version data entries
40 entries across 38 versions & 2 rubygems