Class: YARD::CodeObjects::Cucumber::ScenarioOutline
- Inherits:
-
NamespaceObject
- Object
- NamespaceObject
- NamespaceObject
- YARD::CodeObjects::Cucumber::ScenarioOutline
- Defined in:
- lib/yard/code_objects/cucumber/scenario_outline.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#description ⇒ Object
Returns the value of attribute description.
-
#examples ⇒ Object
Returns the value of attribute examples.
-
#feature ⇒ Object
Returns the value of attribute feature.
-
#keyword ⇒ Object
Returns the value of attribute keyword.
-
#scenarios ⇒ Object
Returns the value of attribute scenarios.
-
#steps ⇒ Object
Returns the value of attribute steps.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #background? ⇒ Boolean
- #example_data ⇒ Object
- #example_hash ⇒ Object
- #example_headers ⇒ Object
- #example_keyword ⇒ Object
- #example_values_for_row(row) ⇒ Object
- #examples? ⇒ Boolean
-
#initialize(namespace, name) ⇒ ScenarioOutline
constructor
A new instance of ScenarioOutline.
- #outline? ⇒ Boolean
Methods included from LocationHelper
#file, #line_number, #location
Constructor Details
#initialize(namespace, name) ⇒ ScenarioOutline
Returns a new instance of ScenarioOutline.
10 11 12 13 14 15 16 17 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 10 def initialize(namespace,name) super(namespace,name.to_s.strip) @comments = @description = @value = @feature = nil @steps = [] @tags = [] @scenarios = [] @examples = {} end |
Instance Attribute Details
#comments ⇒ Object
Returns the value of attribute comments.
7 8 9 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 7 def comments @comments end |
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 7 def description @description end |
#examples ⇒ Object
Returns the value of attribute examples.
8 9 10 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 8 def examples @examples end |
#feature ⇒ Object
Returns the value of attribute feature.
7 8 9 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 7 def feature @feature end |
#keyword ⇒ Object
Returns the value of attribute keyword.
7 8 9 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 7 def keyword @keyword end |
#scenarios ⇒ Object
Returns the value of attribute scenarios.
8 9 10 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 8 def scenarios @scenarios end |
#steps ⇒ Object
Returns the value of attribute steps.
7 8 9 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 7 def steps @steps end |
#tags ⇒ Object
Returns the value of attribute tags.
7 8 9 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 7 def @tags end |
#value ⇒ Object
Returns the value of attribute value.
7 8 9 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 7 def value @value end |
Instance Method Details
#background? ⇒ Boolean
19 20 21 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 19 def background? false end |
#example_data ⇒ Object
39 40 41 42 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 39 def example_data return "" unless @examples[:rows] @examples[:rows][1..-1] end |
#example_hash ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 54 def example_hash hash = {} @examples[:rows].each_with_index do |header,index| hash[header] = @examples[:rows].collect {|row| row[index] } end hash end |
#example_headers ⇒ Object
35 36 37 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 35 def example_headers @examples[:rows].first end |
#example_keyword ⇒ Object
31 32 33 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 31 def example_keyword @examples[:keyword] end |
#example_values_for_row(row) ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 44 def example_values_for_row(row) hash = {} example_headers.each_with_index do |header,index| hash[header] = example_data[row][index] end hash end |
#examples? ⇒ Boolean
27 28 29 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 27 def examples? !@examples[:rows].nil? end |
#outline? ⇒ Boolean
23 24 25 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 23 def outline? true end |