Sha256: 48bcfee7d68d909b722dc04c4075a014fab69a8773b1d28f1ba30b2890a7662f

Contents?: true

Size: 724 Bytes

Versions: 27

Compression:

Stored size: 724 Bytes

Contents

Given /^there is a wire server (running |)on port (\d+) which understands the following protocol:$/ do |running, port, table|
  protocol = table.hashes
  @server = FakeWireServer.new(port.to_i, protocol)
  start_wire_server if running.strip == "running"
end

Given /^the wire server takes (.*) seconds to respond to the invoke message$/ do |timeout|
  @server.delay_response(:invoke, timeout.to_f)
  start_wire_server
end

module WireHelper
  def start_wire_server
    @wire_pid = fork do
      @server.run
    end
  end
  
  def stop_wire_server
    return unless @wire_pid
    Process.kill('KILL', @wire_pid)
    Process.wait
  end
end

Before('@wire') do
  extend(WireHelper)
end

After('@wire') do
  stop_wire_server
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
cucumber-0.8.7 features/step_definitions/wire_steps.rb
cucumber-0.8.5 features/step_definitions/wire_steps.rb
cucumber-0.8.4 features/step_definitions/wire_steps.rb
cucumber-0.8.3 features/step_definitions/wire_steps.rb
cucumber-0.8.2 features/step_definitions/wire_steps.rb
cucumber-0.8.1 features/step_definitions/wire_steps.rb
cucumber-0.8.0 features/step_definitions/wire_steps.rb
cucumber-0.7.3 features/step_definitions/wire_steps.rb
cucumber-0.7.2 features/step_definitions/wire_steps.rb
cucumber-0.7.1 features/step_definitions/wire_steps.rb
cucumber-0.7.0 features/step_definitions/wire_steps.rb
cucumber-0.7.0.beta.8 features/step_definitions/wire_steps.rb
cucumber-0.7.0.beta.7 features/step_definitions/wire_steps.rb
cucumber-0.7.0.beta.6 features/step_definitions/wire_steps.rb
cucumber-0.7.0.beta.5 features/step_definitions/wire_steps.rb
cucumber-0.7.0.beta.4 features/step_definitions/wire_steps.rb
cucumber-0.7.0.beta.3 features/step_definitions/wire_steps.rb
cucumber-0.7.0.beta.2 features/step_definitions/wire_steps.rb
cucumber-0.7.0.beta.1 features/step_definitions/wire_steps.rb
cucumber-0.6.4 features/step_definitions/wire_steps.rb