Class: Cucumber::Core::Test::Case::NameBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/core/test/case.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(test_case) ⇒ NameBuilder

Returns a new instance of NameBuilder.



90
91
92
# File 'lib/cucumber/core/test/case.rb', line 90

def initialize(test_case)
  test_case.describe_source_to self
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



88
89
90
# File 'lib/cucumber/core/test/case.rb', line 88

def result
  @result
end

Instance Method Details

#examples_table(table) ⇒ Object



108
109
110
111
112
113
# File 'lib/cucumber/core/test/case.rb', line 108

def examples_table(table)
  name = table.name.strip
  name = table.keyword if name.length == 0
  @result << ", #{name}"
  self
end

#examples_table_row(row) ⇒ Object



115
116
117
118
# File 'lib/cucumber/core/test/case.rb', line 115

def examples_table_row(row)
  @result << " (row #{row.number})"
  self
end

#featureObject



94
95
96
# File 'lib/cucumber/core/test/case.rb', line 94

def feature(*)
  self
end

#scenario(scenario) ⇒ Object



98
99
100
101
# File 'lib/cucumber/core/test/case.rb', line 98

def scenario(scenario)
  @result = "#{scenario.keyword}: #{scenario.name}"
  self
end

#scenario_outline(outline) ⇒ Object



103
104
105
106
# File 'lib/cucumber/core/test/case.rb', line 103

def scenario_outline(outline)
  @result = "#{outline.keyword}: #{outline.name}"
  self
end