Class: Cucumber::WireSupport::WireLanguage
Overview
The wire-protocol (language independent) implementation of the programming language API.
Defined Under Namespace
Classes: MultilineArgClassName
Instance Method Summary
collapse
#add_hook, #add_transform, #after_configuration, #available_step_definition, #clear_hooks, #execute_transforms, #hooks_for, #invoked_step_definition, #unmatched_step_definitions
Constructor Details
Returns a new instance of WireLanguage.
17
18
19
|
# File 'lib/cucumber/wire_support/wire_language.rb', line 17
def initialize(_=nil)
@connections = []
end
|
Instance Method Details
#begin_scenario(scenario) ⇒ Object
37
38
39
40
|
# File 'lib/cucumber/wire_support/wire_language.rb', line 37
def begin_scenario(scenario)
@connections.each { |c| c.begin_scenario(scenario) }
@current_scenario = scenario
end
|
#end_scenario ⇒ Object
42
43
44
45
46
|
# File 'lib/cucumber/wire_support/wire_language.rb', line 42
def end_scenario
scenario = @current_scenario
@connections.each { |c| c.end_scenario(scenario) }
@current_scenario = nil
end
|
#load_code_file(wire_file) ⇒ Object
21
22
23
24
|
# File 'lib/cucumber/wire_support/wire_language.rb', line 21
def load_code_file(wire_file)
config = Configuration.from_file(wire_file)
@connections << Connection.new(config)
end
|
#snippet_text(code_keyword, step_name, multiline_arg, snippet_type) ⇒ Object
26
27
28
29
30
31
|
# File 'lib/cucumber/wire_support/wire_language.rb', line 26
def snippet_text(code_keyword, step_name, multiline_arg, snippet_type)
snippets = @connections.map do |remote|
remote.snippet_text(code_keyword, step_name, MultilineArgClassName.new(multiline_arg).to_s)
end
snippets.flatten.join("\n")
end
|
#step_matches(step_name, formatted_step_name) ⇒ Object
33
34
35
|
# File 'lib/cucumber/wire_support/wire_language.rb', line 33
def step_matches(step_name, formatted_step_name)
@connections.map{ |c| c.step_matches(step_name, formatted_step_name)}.flatten
end
|