Class: Cucumber::WireSupport::WireProtocol::Requests::Invoke

Inherits:
RequestHandler show all
Defined in:
lib/cucumber/wire_support/wire_protocol/requests.rb

Instance Method Summary collapse

Methods inherited from RequestHandler

#handle_fail, #handle_success, #initialize

Constructor Details

This class inherits a constructor from Cucumber::WireSupport::RequestHandler

Instance Method Details

#execute(step_definition_id, args) ⇒ Object



56
57
58
59
60
61
62
# File 'lib/cucumber/wire_support/wire_protocol/requests.rb', line 56

def execute(step_definition_id, args)
  request_params = { 
    :id => step_definition_id, 
    :args => args
  }
  super(request_params)
end

#handle_diff(tables) ⇒ Object



74
75
76
77
78
79
80
81
# File 'lib/cucumber/wire_support/wire_protocol/requests.rb', line 74

def handle_diff(tables)
  begin
    handle_diff!(tables)
  rescue Cucumber::Ast::Table::Different
    @connection.diff_failed
  end
  @connection.diff_ok
end

#handle_diff!(tables) ⇒ Object



68
69
70
71
72
# File 'lib/cucumber/wire_support/wire_protocol/requests.rb', line 68

def handle_diff!(tables)
  table1 = Ast::Table.new(tables[0])
  table2 = Ast::Table.new(tables[1])
  table1.diff!(table2)
end

#handle_pending(message) ⇒ Object

Raises:



64
65
66
# File 'lib/cucumber/wire_support/wire_protocol/requests.rb', line 64

def handle_pending(message)
  raise Pending, message || "TODO"
end