Class: Cucumber::Wire::Protocol::Requests::Invoke

Inherits:
RequestHandler show all
Defined in:
lib/cucumber/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::Wire::RequestHandler

Instance Method Details

#execute(step_definition_id, args) ⇒ Object



58
59
60
61
62
63
64
# File 'lib/cucumber/wire/protocol/requests.rb', line 58

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

#handle_diff(tables) ⇒ Object



78
79
80
81
82
83
84
85
# File 'lib/cucumber/wire/protocol/requests.rb', line 78

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

#handle_diff!(tables) ⇒ Object



70
71
72
73
74
75
76
# File 'lib/cucumber/wire/protocol/requests.rb', line 70

def handle_diff!(tables)
  # TODO: figure out if / how we could get a location for a table from the wire (or make a null location)
  location = Core::Ast::Location.new(__FILE__, __LINE__)
  table1 = table(tables[0], location)
  table2 = table(tables[1], location)
  table1.diff!(table2)
end

#handle_pending(message) ⇒ Object

Raises:

  • (Pending)


66
67
68
# File 'lib/cucumber/wire/protocol/requests.rb', line 66

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