Class: Cucumber::Wire::Connection
- Inherits:
-
Object
- Object
- Cucumber::Wire::Connection
- Includes:
- Protocol
- Defined in:
- lib/cucumber/wire/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 Protocol
#begin_scenario, #diff_failed, #diff_ok, #end_scenario, #invoke, #snippet_text, #step_matches
Constructor Details
#initialize(config) ⇒ Connection
Returns a new instance of Connection.
13 14 15 |
# File 'lib/cucumber/wire/connection.rb', line 13 def initialize(config) @config = config end |
Instance Method Details
#call_remote(request_handler, message, params) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cucumber/wire/connection.rb', line 17 def call_remote(request_handler, , params) packet = DataPacket.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 |