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
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#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(id, text, location, multiline_arg = Test::EmptyMultilineArgument.new, action = Test::Action::Undefined.new(location)) ⇒ Step
constructor
A new instance of Step.
- #inspect ⇒ Object
- #matching_locations ⇒ Object
- #skip(*args) ⇒ Object
- #to_s ⇒ Object
- #with_action(action_location = nil, &block) ⇒ Object
Constructor Details
#initialize(id, text, location, multiline_arg = Test::EmptyMultilineArgument.new, action = Test::Action::Undefined.new(location)) ⇒ Step
Returns a new instance of Step.
13 14 15 16 17 18 19 20 21 |
# File 'lib/cucumber/core/test/step.rb', line 13 def initialize(id, text, location, multiline_arg = Test::EmptyMultilineArgument.new, action = Test::Action::Undefined.new(location)) raise ArgumentError if text.nil? || text.empty? @id = id @text = text @location = location @multiline_arg = multiline_arg @action = action end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
11 12 13 |
# File 'lib/cucumber/core/test/step.rb', line 11 def id @id end |
#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
51 52 53 |
# File 'lib/cucumber/core/test/step.rb', line 51 def action_location @action.location end |
#backtrace_line ⇒ Object
43 44 45 |
# File 'lib/cucumber/core/test/step.rb', line 43 def backtrace_line "#{location}:in `#{text}'" end |
#describe_to(visitor, *args) ⇒ Object
23 24 25 |
# File 'lib/cucumber/core/test/step.rb', line 23 def describe_to(visitor, *args) visitor.test_step(self, *args) end |
#execute(*args) ⇒ Object
35 36 37 |
# File 'lib/cucumber/core/test/step.rb', line 35 def execute(*args) @action.execute(*args) end |
#hook? ⇒ Boolean
27 28 29 |
# File 'lib/cucumber/core/test/step.rb', line 27 def hook? false end |
#inspect ⇒ Object
59 60 61 |
# File 'lib/cucumber/core/test/step.rb', line 59 def inspect "#<#{self.class}: #{location}>" end |
#matching_locations ⇒ Object
55 56 57 |
# File 'lib/cucumber/core/test/step.rb', line 55 def matching_locations [location.merge(multiline_arg)] end |
#skip(*args) ⇒ Object
31 32 33 |
# File 'lib/cucumber/core/test/step.rb', line 31 def skip(*args) @action.skip(*args) end |
#to_s ⇒ Object
47 48 49 |
# File 'lib/cucumber/core/test/step.rb', line 47 def to_s text end |