Class: Cucumber::Formatter::NameBuilder
- Defined in:
- lib/cucumber/formatter/junit.rb
Instance Attribute Summary collapse
-
#name_suffix ⇒ Object
readonly
Returns the value of attribute name_suffix.
-
#row_name ⇒ Object
readonly
Returns the value of attribute row_name.
-
#scenario_name ⇒ Object
readonly
Returns the value of attribute scenario_name.
Instance Method Summary collapse
- #examples_table ⇒ Object
- #examples_table_row(row) ⇒ Object
- #feature ⇒ Object
-
#initialize(test_case) ⇒ NameBuilder
constructor
A new instance of NameBuilder.
- #scenario(scenario) ⇒ Object
- #scenario_outline(outline) ⇒ Object
Constructor Details
#initialize(test_case) ⇒ NameBuilder
Returns a new instance of NameBuilder.
182 183 184 185 186 |
# File 'lib/cucumber/formatter/junit.rb', line 182 def initialize(test_case) @name_suffix = "" @row_name = "" test_case.describe_source_to self end |
Instance Attribute Details
#name_suffix ⇒ Object (readonly)
Returns the value of attribute name_suffix.
180 181 182 |
# File 'lib/cucumber/formatter/junit.rb', line 180 def name_suffix @name_suffix end |
#row_name ⇒ Object (readonly)
Returns the value of attribute row_name.
180 181 182 |
# File 'lib/cucumber/formatter/junit.rb', line 180 def row_name @row_name end |
#scenario_name ⇒ Object (readonly)
Returns the value of attribute scenario_name.
180 181 182 |
# File 'lib/cucumber/formatter/junit.rb', line 180 def scenario_name @scenario_name end |
Instance Method Details
#examples_table ⇒ Object
202 203 204 |
# File 'lib/cucumber/formatter/junit.rb', line 202 def examples_table(*) self end |
#examples_table_row(row) ⇒ Object
206 207 208 209 210 |
# File 'lib/cucumber/formatter/junit.rb', line 206 def examples_table_row(row) @row_name = '| ' + row.values.join(' | ') + ' |' @name_suffix = " (outline example : #{@row_name})" self end |
#feature ⇒ Object
188 189 190 |
# File 'lib/cucumber/formatter/junit.rb', line 188 def feature(*) self end |
#scenario(scenario) ⇒ Object
192 193 194 195 |
# File 'lib/cucumber/formatter/junit.rb', line 192 def scenario(scenario) @scenario_name = (scenario.name.nil? || scenario.name == "") ? "Unnamed scenario" : scenario.name self end |
#scenario_outline(outline) ⇒ Object
197 198 199 200 |
# File 'lib/cucumber/formatter/junit.rb', line 197 def scenario_outline(outline) @scenario_name = (outline.name.nil? || outline.name == "") ? "Unnamed scenario outline" : outline.name self end |