Class: Cucumber::Wire::Connections
- Inherits:
-
Object
- Object
- Cucumber::Wire::Connections
- Defined in:
- lib/cucumber/wire/connections.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
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.
20 21 22 23 24 25 26 |
# File 'lib/cucumber/wire/connections.rb', line 20 def initialize(connections, configuration, registry) raise ArgumentError unless connections @connections = connections @configuration = configuration @registry = registry end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
17 18 19 |
# File 'lib/cucumber/wire/connections.rb', line 17 def configuration @configuration end |
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
17 18 19 |
# File 'lib/cucumber/wire/connections.rb', line 17 def registry @registry end |
Instance Method Details
#begin_scenario(test_case) ⇒ Object
40 41 42 |
# File 'lib/cucumber/wire/connections.rb', line 40 def begin_scenario(test_case) connections.each { |c| c.begin_scenario(test_case) } end |
#end_scenario(test_case) ⇒ Object
44 45 46 |
# File 'lib/cucumber/wire/connections.rb', line 44 def end_scenario(test_case) connections.each { |c| c.end_scenario(test_case) } end |
#find_match(test_step) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/cucumber/wire/connections.rb', line 28 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
48 49 50 |
# File 'lib/cucumber/wire/connections.rb', line 48 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
36 37 38 |
# File 'lib/cucumber/wire/connections.rb', line 36 def step_matches(step_name) connections.map { |c| c.step_matches(step_name, @registry) }.flatten end |