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


190
191
192
193
194
# File 'lib/cucumber/formatter/junit.rb', line 190

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


188
189
190
# File 'lib/cucumber/formatter/junit.rb', line 188

def name_suffix
  @name_suffix
end

#row_nameObject (readonly)

Returns the value of attribute row_name


188
189
190
# File 'lib/cucumber/formatter/junit.rb', line 188

def row_name
  @row_name
end

#scenario_nameObject (readonly)

Returns the value of attribute scenario_name


188
189
190
# File 'lib/cucumber/formatter/junit.rb', line 188

def scenario_name
  @scenario_name
end

Instance Method Details

#examples_tableObject


210
211
212
# File 'lib/cucumber/formatter/junit.rb', line 210

def examples_table(*)
  self
end

#examples_table_row(row) ⇒ Object


214
215
216
217
218
# File 'lib/cucumber/formatter/junit.rb', line 214

def examples_table_row(row)
  @row_name = '| ' + row.values.join(' | ') + ' |'
  @name_suffix = " (outline example : #{@row_name})"
  self
end

#featureObject


196
197
198
# File 'lib/cucumber/formatter/junit.rb', line 196

def feature(*)
  self
end

#scenario(scenario) ⇒ Object


200
201
202
203
# File 'lib/cucumber/formatter/junit.rb', line 200

def scenario(scenario)
  @scenario_name = (scenario.name.nil? || scenario.name == '') ? 'Unnamed scenario' : scenario.name
  self
end

#scenario_outline(outline) ⇒ Object


205
206
207
208
# File 'lib/cucumber/formatter/junit.rb', line 205

def scenario_outline(outline)
  @scenario_name = (outline.name.nil? || outline.name == '') ? 'Unnamed scenario outline' : outline.name
  self
end