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
- #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.
11 12 13 14 |
# File 'lib/cucumber/core/test/step.rb', line 11 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.
9 10 11 |
# File 'lib/cucumber/core/test/step.rb', line 9 def source @source end |
Instance Method Details
#action_location ⇒ Object
47 48 49 |
# File 'lib/cucumber/core/test/step.rb', line 47 def action_location @action.location end |
#describe_source_to(visitor, *args) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/cucumber/core/test/step.rb', line 20 def describe_source_to(visitor, *args) source.reverse.each do |node| node.describe_to(visitor, *args) end self end |
#describe_to(visitor, *args) ⇒ Object
16 17 18 |
# File 'lib/cucumber/core/test/step.rb', line 16 def describe_to(visitor, *args) visitor.test_step(self, *args) end |
#execute(*args) ⇒ Object
31 32 33 |
# File 'lib/cucumber/core/test/step.rb', line 31 def execute(*args) @action.execute(*args) end |
#inspect ⇒ Object
51 52 53 |
# File 'lib/cucumber/core/test/step.rb', line 51 def inspect "#<#{self.class}: #{location}>" end |
#location ⇒ Object
43 44 45 |
# File 'lib/cucumber/core/test/step.rb', line 43 def location source.last.location end |
#name ⇒ Object
39 40 41 |
# File 'lib/cucumber/core/test/step.rb', line 39 def name source.last.name end |
#skip(*args) ⇒ Object
27 28 29 |
# File 'lib/cucumber/core/test/step.rb', line 27 def skip(*args) @action.skip(*args) end |