Class: Cucumber::Formatter::NameBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/formatter/junit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_suffixObject (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_nameObject (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_nameObject (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_tableObject



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

#featureObject



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