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.



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

def initialize(test_case)
  test_case.describe_source_to self
end

Instance Attribute Details

#keywordObject (readonly)

Returns the value of attribute keyword.



112
113
114
# File 'lib/cucumber/core/test/case.rb', line 112

def keyword
  @keyword
end

#resultObject (readonly)

Returns the value of attribute result.



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

def result
  @result
end

Instance Method Details

#examples_table(table) ⇒ Object



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

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



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

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

#featureObject



118
119
120
# File 'lib/cucumber/core/test/case.rb', line 118

def feature(*)
  self
end

#scenario(scenario) ⇒ Object



122
123
124
125
126
# File 'lib/cucumber/core/test/case.rb', line 122

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

#scenario_outline(outline) ⇒ Object



128
129
130
131
132
# File 'lib/cucumber/core/test/case.rb', line 128

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