Class: Cucumber::Core::Test::Step
- Inherits:
-
Object
- Object
- Cucumber::Core::Test::Step
- Defined in:
- lib/cucumber/core/test/step.rb
Instance Method Summary collapse
- #describe_source_to(visitor, *args) ⇒ Object
- #describe_to(visitor, *args) ⇒ Object
- #execute ⇒ Object
-
#initialize(source, mapping = Test::UndefinedMapping.new) ⇒ Step
constructor
A new instance of Step.
- #inspect ⇒ Object
- #location ⇒ Object
- #map(&block) ⇒ Object
- #match_locations?(queried_locations) ⇒ Boolean
- #multiline_arg ⇒ Object
- #name ⇒ Object
- #skip ⇒ Object
Constructor Details
#initialize(source, mapping = Test::UndefinedMapping.new) ⇒ Step
Returns a new instance of Step.
11 12 13 14 15 |
# File 'lib/cucumber/core/test/step.rb', line 11 def initialize(source, mapping = Test::UndefinedMapping.new) raise ArgumentError if source.any?(&:nil?) @mapping = mapping super(source) end |
Instance Method Details
#describe_source_to(visitor, *args) ⇒ Object
21 22 23 24 25 |
# File 'lib/cucumber/core/test/step.rb', line 21 def describe_source_to(visitor, *args) source.each do |node| node.describe_to(visitor, *args) end end |
#describe_to(visitor, *args) ⇒ Object
17 18 19 |
# File 'lib/cucumber/core/test/step.rb', line 17 def describe_to(visitor, *args) visitor.test_step(self, *args) end |
#execute ⇒ Object
39 40 41 |
# File 'lib/cucumber/core/test/step.rb', line 39 def execute @mapping.execute end |
#inspect ⇒ Object
56 57 58 |
# File 'lib/cucumber/core/test/step.rb', line 56 def inspect "#{self.class}: #{location}" end |
#location ⇒ Object
47 48 49 |
# File 'lib/cucumber/core/test/step.rb', line 47 def location step.location end |
#map(&block) ⇒ Object
43 44 45 |
# File 'lib/cucumber/core/test/step.rb', line 43 def map(&block) self.class.new(source, Test::Mapping.new(&block)) end |
#match_locations?(queried_locations) ⇒ Boolean
51 52 53 54 |
# File 'lib/cucumber/core/test/step.rb', line 51 def match_locations?(queried_locations) return true if queried_locations.include? location source.any? { |s| s.match_locations?(queried_locations) } end |
#multiline_arg ⇒ Object
31 32 33 |
# File 'lib/cucumber/core/test/step.rb', line 31 def multiline_arg step.multiline_arg end |
#name ⇒ Object
27 28 29 |
# File 'lib/cucumber/core/test/step.rb', line 27 def name step.name end |
#skip ⇒ Object
35 36 37 |
# File 'lib/cucumber/core/test/step.rb', line 35 def skip @mapping.skip end |