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.



140
141
142
# File 'lib/cucumber/core/test/case.rb', line 140

def initialize(test_case)
  test_case.describe_source_to self
end

Instance Attribute Details

#keywordObject (readonly)

Returns the value of attribute keyword.



138
139
140
# File 'lib/cucumber/core/test/case.rb', line 138

def keyword
  @keyword
end

#resultObject (readonly)

Returns the value of attribute result.



137
138
139
# File 'lib/cucumber/core/test/case.rb', line 137

def result
  @result
end

Instance Method Details

#examples_table(table) ⇒ Object



160
161
162
163
164
165
# File 'lib/cucumber/core/test/case.rb', line 160

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

#examples_table_row(row) ⇒ Object



167
168
169
170
# File 'lib/cucumber/core/test/case.rb', line 167

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

#featureObject



144
145
146
# File 'lib/cucumber/core/test/case.rb', line 144

def feature(*)
  self
end

#scenario(scenario) ⇒ Object



148
149
150
151
152
# File 'lib/cucumber/core/test/case.rb', line 148

def scenario(scenario)
  @result = scenario.name
  @keyword = scenario.keyword
  self
end

#scenario_outline(outline) ⇒ Object



154
155
156
157
158
# File 'lib/cucumber/core/test/case.rb', line 154

def scenario_outline(outline)
  @result = outline.name + @result
  @keyword = outline.keyword
  self
end