Class: Cucumber::WireSupport::Connection
- Includes:
- WireProtocol
- Defined in:
- lib/cucumber/wire_support/connection.rb
Defined Under Namespace
Classes: ConnectionError
Instance Method Summary collapse
- #call_remote(request_handler, message, params) ⇒ Object
- #exception(params) ⇒ Object
-
#initialize(config) ⇒ Connection
constructor
A new instance of Connection.
Methods included from WireProtocol
#begin_scenario, #diff_failed, #diff_ok, #end_scenario, #invoke, #snippet_text, #step_matches
Constructor Details
#initialize(config) ⇒ Connection
Returns a new instance of Connection.
11 12 13 |
# File 'lib/cucumber/wire_support/connection.rb', line 11 def initialize(config) @config = config end |
Instance Method Details
#call_remote(request_handler, message, params) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/cucumber/wire_support/connection.rb', line 15 def call_remote(request_handler, , params) packet = WirePacket.new(, params) begin send_data_to_socket(packet.to_json) response = fetch_data_from_socket(@config.timeout()) response.handle_with(request_handler) rescue Timeout::Error => e backtrace = e.backtrace ; backtrace.shift # because Timeout puts some wierd stuff in there raise Timeout::Error, "Timed out calling wire server with message '#{}'", backtrace end end |
#exception(params) ⇒ Object
28 29 30 |
# File 'lib/cucumber/wire_support/connection.rb', line 28 def exception(params) WireException.new(params, @config) end |