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.



184
185
186
187
188
# File 'lib/cucumber/formatter/junit.rb', line 184

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.



182
183
184
# File 'lib/cucumber/formatter/junit.rb', line 182

def name_suffix
  @name_suffix
end

#row_nameObject (readonly)

Returns the value of attribute row_name.



182
183
184
# File 'lib/cucumber/formatter/junit.rb', line 182

def row_name
  @row_name
end

#scenario_nameObject (readonly)

Returns the value of attribute scenario_name.



182
183
184
# File 'lib/cucumber/formatter/junit.rb', line 182

def scenario_name
  @scenario_name
end

Instance Method Details

#examples_tableObject



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

def examples_table(*)
  self
end

#examples_table_row(row) ⇒ Object



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

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

#featureObject



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

def feature(*)
  self
end

#scenario(scenario) ⇒ Object



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

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

#scenario_outline(outline) ⇒ Object



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

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