Class: Cucumber::Core::Test::Step
- Inherits:
-
Object
- Object
- Cucumber::Core::Test::Step
- Defined in:
- lib/cucumber/core/test/step.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#multiline_arg ⇒ Object
readonly
Returns the value of attribute multiline_arg.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #action_location ⇒ Object
- #backtrace_line ⇒ Object
- #describe_to(visitor, *args) ⇒ Object
- #execute(*args) ⇒ Object
- #hook? ⇒ Boolean
-
#initialize(text, location, multiline_arg = Test::EmptyMultilineArgument.new, action = Test::UndefinedAction.new(location)) ⇒ Step
constructor
A new instance of Step.
- #inspect ⇒ Object
- #skip(*args) ⇒ Object
- #to_s ⇒ Object
- #with_action(action_location = nil, &block) ⇒ Object
Constructor Details
#initialize(text, location, multiline_arg = Test::EmptyMultilineArgument.new, action = Test::UndefinedAction.new(location)) ⇒ Step
Returns a new instance of Step.
13 14 15 16 17 18 19 |
# File 'lib/cucumber/core/test/step.rb', line 13 def initialize(text, location, multiline_arg = Test::EmptyMultilineArgument.new, action = Test::UndefinedAction.new(location)) raise ArgumentError if text.nil? || text.empty? @text = text @location = location @multiline_arg = multiline_arg @action = action end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
11 12 13 |
# File 'lib/cucumber/core/test/step.rb', line 11 def location @location end |
#multiline_arg ⇒ Object (readonly)
Returns the value of attribute multiline_arg.
11 12 13 |
# File 'lib/cucumber/core/test/step.rb', line 11 def multiline_arg @multiline_arg end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
11 12 13 |
# File 'lib/cucumber/core/test/step.rb', line 11 def text @text end |
Instance Method Details
#action_location ⇒ Object
49 50 51 |
# File 'lib/cucumber/core/test/step.rb', line 49 def action_location @action.location end |
#backtrace_line ⇒ Object
41 42 43 |
# File 'lib/cucumber/core/test/step.rb', line 41 def backtrace_line "#{location}:in `#{text}'" end |
#describe_to(visitor, *args) ⇒ Object
21 22 23 |
# File 'lib/cucumber/core/test/step.rb', line 21 def describe_to(visitor, *args) visitor.test_step(self, *args) end |
#execute(*args) ⇒ Object
33 34 35 |
# File 'lib/cucumber/core/test/step.rb', line 33 def execute(*args) @action.execute(*args) end |
#hook? ⇒ Boolean
25 26 27 |
# File 'lib/cucumber/core/test/step.rb', line 25 def hook? false end |
#inspect ⇒ Object
53 54 55 |
# File 'lib/cucumber/core/test/step.rb', line 53 def inspect "#<#{self.class}: #{location}>" end |
#skip(*args) ⇒ Object
29 30 31 |
# File 'lib/cucumber/core/test/step.rb', line 29 def skip(*args) @action.skip(*args) end |
#to_s ⇒ Object
45 46 47 |
# File 'lib/cucumber/core/test/step.rb', line 45 def to_s text end |