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



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

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

#handle_diff(tables) ⇒ Object



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

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



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

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::Test::Location.new(__FILE__, __LINE__)
  table1 = table(tables[0], location)
  table2 = table(tables[1], location)
  table1.diff!(table2)
end

#handle_pending(message) ⇒ Object

Raises:

  • (Pending)


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

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