Class: Gurke::Step
- Inherits:
-
Object
- Object
- Gurke::Step
- Defined in:
- lib/gurke/step.rb
Defined Under Namespace
Classes: StepResult
Instance Attribute Summary collapse
-
#file ⇒ String
readonly
Return path to file containing this scenario.
-
#line ⇒ Fixnum
readonly
Return line number where the scenario is defined.
- #raw ⇒ Object readonly private
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #doc_string ⇒ Object
-
#initialize(file, line, type, raw) ⇒ Step
constructor
private
A new instance of Step.
- #keyword ⇒ Object
- #name ⇒ Object (also: #to_s)
- #run(runner, reporter, scenario, world) ⇒ Object private
Constructor Details
#initialize(file, line, type, raw) ⇒ Step
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Step.
24 25 26 27 28 29 |
# File 'lib/gurke/step.rb', line 24 def initialize(file, line, type, raw) @file = file @line = line @type = type @raw = raw end |
Instance Attribute Details
#file ⇒ String (readonly)
Return path to file containing this scenario.
10 11 12 |
# File 'lib/gurke/step.rb', line 10 def file @file end |
#line ⇒ Fixnum (readonly)
Return line number where the scenario is defined.
16 17 18 |
# File 'lib/gurke/step.rb', line 16 def line @line end |
#raw ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 |
# File 'lib/gurke/step.rb', line 21 def raw @raw end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
18 19 20 |
# File 'lib/gurke/step.rb', line 18 def type @type end |
Instance Method Details
#doc_string ⇒ Object
40 41 42 |
# File 'lib/gurke/step.rb', line 40 def doc_string raw.doc_string&.value end |
#keyword ⇒ Object
36 37 38 |
# File 'lib/gurke/step.rb', line 36 def keyword raw.keyword.strip end |
#name ⇒ Object Also known as: to_s
31 32 33 |
# File 'lib/gurke/step.rb', line 31 def name raw.name end |
#run(runner, reporter, scenario, world) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
46 47 48 49 50 51 52 |
# File 'lib/gurke/step.rb', line 46 def run(runner, reporter, scenario, world) reporter.invoke :before_step, self, scenario run_step(runner, reporter, scenario, world).tap do |result| reporter.invoke :after_step, result, scenario end end |