Class: Cucumber::Wire::Connections
- Inherits:
-
Object
- Object
- Cucumber::Wire::Connections
- Defined in:
- lib/cucumber/wire/connections.rb
Instance Method Summary collapse
- #begin_scenario(test_case) ⇒ Object
- #end_scenario(test_case) ⇒ Object
- #find_match(test_step) ⇒ Object
-
#initialize(connections, configuration, registry) ⇒ Connections
constructor
A new instance of Connections.
- #snippets(code_keyword, step_name, multiline_arg_class_name) ⇒ Object
- #step_matches(step_name) ⇒ Object
Constructor Details
#initialize(connections, configuration, registry) ⇒ Connections
Returns a new instance of Connections.
19 20 21 22 23 24 |
# File 'lib/cucumber/wire/connections.rb', line 19 def initialize(connections, configuration, registry) raise ArgumentError unless connections @connections = connections @configuration = configuration @registry = registry end |
Instance Method Details
#begin_scenario(test_case) ⇒ Object
37 38 39 |
# File 'lib/cucumber/wire/connections.rb', line 37 def begin_scenario(test_case) connections.each { |c| c.begin_scenario(test_case) } end |
#end_scenario(test_case) ⇒ Object
41 42 43 |
# File 'lib/cucumber/wire/connections.rb', line 41 def end_scenario(test_case) connections.each { |c| c.end_scenario(test_case) } end |
#find_match(test_step) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/cucumber/wire/connections.rb', line 26 def find_match(test_step) matches = step_matches(test_step.name) return unless matches.any? # TODO: handle ambiguous matches (push to cucumber?) matches.first end |
#snippets(code_keyword, step_name, multiline_arg_class_name) ⇒ Object
45 46 47 |
# File 'lib/cucumber/wire/connections.rb', line 45 def snippets(code_keyword, step_name, multiline_arg_class_name) connections.map { |c| c.snippet_text(code_keyword, step_name, multiline_arg_class_name) }.flatten end |
#step_matches(step_name) ⇒ Object
33 34 35 |
# File 'lib/cucumber/wire/connections.rb', line 33 def step_matches(step_name) connections.map{ |c| c.step_matches(step_name, @registry)}.flatten end |