Class: Cucumber::Core::Test::Step
- Inherits:
-
Object
- Object
- Cucumber::Core::Test::Step
- Defined in:
- lib/cucumber/core/test/step.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #action_location ⇒ Object
- #describe_source_to(visitor, *args) ⇒ Object
- #describe_to(visitor, *args) ⇒ Object
- #execute(*args) ⇒ Object
-
#initialize(source, action = Test::UndefinedAction.new(source.last.location)) ⇒ Step
constructor
A new instance of Step.
- #inspect ⇒ Object
- #location ⇒ Object
- #match_locations?(queried_locations) ⇒ Boolean
- #name ⇒ Object
- #skip(*args) ⇒ Object
- #with_action(location = nil, &block) ⇒ Object
Constructor Details
#initialize(source, action = Test::UndefinedAction.new(source.last.location)) ⇒ Step
Returns a new instance of Step.
10 11 12 13 |
# File 'lib/cucumber/core/test/step.rb', line 10 def initialize(source, action = Test::UndefinedAction.new(source.last.location)) raise ArgumentError if source.any?(&:nil?) @source, @action = source, action end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
8 9 10 |
# File 'lib/cucumber/core/test/step.rb', line 8 def source @source end |
Instance Method Details
#action_location ⇒ Object
46 47 48 |
# File 'lib/cucumber/core/test/step.rb', line 46 def action_location @action.location end |
#describe_source_to(visitor, *args) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/cucumber/core/test/step.rb', line 19 def describe_source_to(visitor, *args) source.reverse.each do |node| node.describe_to(visitor, *args) end self end |
#describe_to(visitor, *args) ⇒ Object
15 16 17 |
# File 'lib/cucumber/core/test/step.rb', line 15 def describe_to(visitor, *args) visitor.test_step(self, *args) end |
#execute(*args) ⇒ Object
30 31 32 |
# File 'lib/cucumber/core/test/step.rb', line 30 def execute(*args) @action.execute(*args) end |
#inspect ⇒ Object
55 56 57 |
# File 'lib/cucumber/core/test/step.rb', line 55 def inspect "#<#{self.class}: #{location}>" end |
#location ⇒ Object
42 43 44 |
# File 'lib/cucumber/core/test/step.rb', line 42 def location source.last.location end |
#match_locations?(queried_locations) ⇒ Boolean
50 51 52 53 |
# File 'lib/cucumber/core/test/step.rb', line 50 def match_locations?(queried_locations) return true if queried_locations.include? location source.any? { |s| s.match_locations?(queried_locations) } end |
#name ⇒ Object
38 39 40 |
# File 'lib/cucumber/core/test/step.rb', line 38 def name source.last.name end |
#skip(*args) ⇒ Object
26 27 28 |
# File 'lib/cucumber/core/test/step.rb', line 26 def skip(*args) @action.skip(*args) end |