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.
22 23 24 25 |
# File 'lib/gurke/step.rb', line 22 def initialize(file, line, type, raw) @file, @line = file, line @type, @raw = type, raw end |
Instance Attribute Details
#file ⇒ String (readonly)
Return path to file containing this scenario.
8 9 10 |
# File 'lib/gurke/step.rb', line 8 def file @file end |
#line ⇒ Fixnum (readonly)
Return line number where the scenario is defined.
14 15 16 |
# File 'lib/gurke/step.rb', line 14 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.
19 20 21 |
# File 'lib/gurke/step.rb', line 19 def raw @raw end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
16 17 18 |
# File 'lib/gurke/step.rb', line 16 def type @type end |
Instance Method Details
#doc_string ⇒ Object
36 37 38 |
# File 'lib/gurke/step.rb', line 36 def doc_string raw.doc_string.value if raw.doc_string end |
#keyword ⇒ Object
32 33 34 |
# File 'lib/gurke/step.rb', line 32 def keyword raw.keyword end |
#name ⇒ Object Also known as: to_s
27 28 29 |
# File 'lib/gurke/step.rb', line 27 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.
42 43 44 45 46 47 48 49 50 |
# File 'lib/gurke/step.rb', line 42 def run(runner, reporter, scenario, world) reporter.invoke :before_step, self, scenario result = runner.hook(:step, world) do run_step runner, reporter, scenario, world end reporter.invoke :after_step, result, scenario end |