kosmas58-cucumber 0.1.99.23 → 0.1.100.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. data/History.txt +8 -23
  2. data/Manifest.txt +14 -2
  3. data/examples/i18n/en-lol/Rakefile +6 -0
  4. data/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb +16 -0
  5. data/examples/i18n/en-lol/features/stuffing.feature +8 -0
  6. data/examples/i18n/en-lol/features/support/env.rb +8 -0
  7. data/examples/i18n/en-lol/lib/basket.rb +12 -0
  8. data/examples/i18n/en-lol/lib/belly.rb +11 -0
  9. data/examples/i18n/et/features/jagamine.feature +9 -0
  10. data/examples/jbehave/README.textile +4 -1
  11. data/examples/jbehave/features/trading.feature +4 -0
  12. data/examples/jbehave/pom.xml +5 -0
  13. data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/scenarios/TraderSteps.java +6 -1
  14. data/examples/selenium/features/step_definitons/search_steps.rb +13 -0
  15. data/examples/selenium/features/support/env.rb +19 -0
  16. data/examples/selenium_webrat/Rakefile +6 -0
  17. data/examples/selenium_webrat/features/search.feature +9 -0
  18. data/examples/selenium_webrat/features/step_definitons/search_steps.rb +13 -0
  19. data/examples/selenium_webrat/features/support/env.rb +41 -0
  20. data/examples/self_test/Rakefile +1 -1
  21. data/examples/self_test/features/background/failing_background.feature +1 -0
  22. data/examples/self_test/features/step_definitions/sample_steps.rb +1 -1
  23. data/examples/self_test/features/support/tag_count_formatter.rb +1 -1
  24. data/examples/tickets/Rakefile +13 -8
  25. data/examples/tickets/cucumber.yml +2 -1
  26. data/examples/tickets/features/236.feature +13 -0
  27. data/examples/tickets/features/241.feature +13 -0
  28. data/examples/tickets/features/step_definitons/tickets_steps.rb +17 -4
  29. data/examples/tickets/features/tickets.feature +1 -1
  30. data/features/background.feature +9 -11
  31. data/features/cucumber_cli.feature +24 -1
  32. data/features/cucumber_cli_outlines.feature +10 -19
  33. data/features/report_called_undefined_steps.feature +2 -0
  34. data/gem_tasks/rspec.rake +3 -2
  35. data/lib/cucumber.rb +7 -15
  36. data/lib/cucumber/ast.rb +3 -3
  37. data/lib/cucumber/ast/background.rb +28 -66
  38. data/lib/cucumber/ast/examples.rb +15 -3
  39. data/lib/cucumber/ast/feature.rb +20 -24
  40. data/lib/cucumber/ast/feature_element.rb +46 -0
  41. data/lib/cucumber/ast/features.rb +2 -21
  42. data/lib/cucumber/ast/outline_table.rb +46 -14
  43. data/lib/cucumber/ast/py_string.rb +9 -3
  44. data/lib/cucumber/ast/scenario.rb +34 -73
  45. data/lib/cucumber/ast/scenario_outline.rb +40 -42
  46. data/lib/cucumber/ast/step.rb +51 -90
  47. data/lib/cucumber/ast/step_collection.rb +66 -0
  48. data/lib/cucumber/ast/step_invocation.rb +110 -0
  49. data/lib/cucumber/ast/table.rb +41 -21
  50. data/lib/cucumber/ast/tags.rb +4 -11
  51. data/lib/cucumber/ast/visitor.rb +35 -19
  52. data/lib/cucumber/broadcaster.rb +1 -3
  53. data/lib/cucumber/cli/configuration.rb +25 -17
  54. data/lib/cucumber/cli/language_help_formatter.rb +4 -4
  55. data/lib/cucumber/cli/main.rb +6 -4
  56. data/lib/cucumber/core_ext/proc.rb +2 -2
  57. data/lib/cucumber/formatter/ansicolor.rb +0 -1
  58. data/lib/cucumber/formatter/console.rb +24 -34
  59. data/lib/cucumber/formatter/html.rb +18 -11
  60. data/lib/cucumber/formatter/pretty.rb +48 -36
  61. data/lib/cucumber/formatter/profile.rb +6 -6
  62. data/lib/cucumber/formatter/progress.rb +14 -22
  63. data/lib/cucumber/formatter/rerun.rb +6 -6
  64. data/lib/cucumber/jbehave.rb +21 -26
  65. data/lib/cucumber/languages.yml +17 -2
  66. data/lib/cucumber/parser/feature.rb +26 -29
  67. data/lib/cucumber/parser/feature.tt +17 -12
  68. data/lib/cucumber/parser/treetop_ext.rb +13 -13
  69. data/lib/cucumber/platform.rb +0 -1
  70. data/lib/cucumber/rails/world.rb +2 -2
  71. data/lib/cucumber/rake/task.rb +1 -2
  72. data/lib/cucumber/step_definition.rb +21 -12
  73. data/lib/cucumber/step_match.rb +49 -0
  74. data/lib/cucumber/step_mother.rb +100 -80
  75. data/lib/cucumber/version.rb +2 -2
  76. data/lib/cucumber/world.rb +53 -0
  77. data/rails_generators/cucumber/templates/paths.rb +1 -1
  78. data/rails_generators/cucumber/templates/webrat_steps.rb +17 -17
  79. data/rails_generators/feature/feature_generator.rb +5 -1
  80. data/rails_generators/feature/templates/steps.erb +0 -4
  81. data/spec/cucumber/ast/background_spec.rb +32 -41
  82. data/spec/cucumber/ast/feature_factory.rb +10 -1
  83. data/spec/cucumber/ast/feature_spec.rb +7 -30
  84. data/spec/cucumber/ast/py_string_spec.rb +7 -0
  85. data/spec/cucumber/ast/scenario_outline_spec.rb +3 -0
  86. data/spec/cucumber/ast/scenario_spec.rb +8 -25
  87. data/spec/cucumber/ast/step_collection_spec.rb +8 -0
  88. data/spec/cucumber/ast/step_spec.rb +49 -28
  89. data/spec/cucumber/ast/table_spec.rb +13 -3
  90. data/spec/cucumber/ast/tags_spec.rb +2 -18
  91. data/spec/cucumber/broadcaster_spec.rb +6 -5
  92. data/spec/cucumber/cli/configuration_spec.rb +7 -0
  93. data/spec/cucumber/cli/main_spec.rb +1 -1
  94. data/spec/cucumber/parser/feature_parser_spec.rb +6 -5
  95. data/spec/cucumber/step_definition_spec.rb +16 -5
  96. data/spec/cucumber/step_mother_spec.rb +6 -6
  97. data/spec/cucumber/world/pending_spec.rb +1 -1
  98. metadata +24 -5
  99. data/lib/cucumber/ast/filter.rb +0 -22
  100. data/lib/cucumber/ast/steps.rb +0 -13
@@ -4,63 +4,66 @@ require 'cucumber/core_ext/string'
4
4
  module Cucumber
5
5
  module Ast
6
6
  class Step
7
- attr_reader :keyword, :name
8
- attr_writer :world, :previous, :options
9
- attr_accessor :status, :scenario, :exception
7
+ attr_reader :line, :keyword, :name, :multiline_arg
8
+ attr_writer :step_collection, :options
9
+ attr_accessor :feature_element, :exception
10
10
 
11
- def initialize(line, keyword, name, *multiline_args)
12
- @line, @keyword, @name, @multiline_args = line, keyword, name, multiline_args
11
+ def initialize(line, keyword, name, multiline_arg=nil)
12
+ @line, @keyword, @name, @multiline_arg = line, keyword, name, multiline_arg
13
13
  end
14
14
 
15
- def execute_with_arguments(argument_hash, world, previous, visitor, row_line)
16
- delimited_arguments = delimit_argument_names(argument_hash)
17
- name = replace_name_arguments(delimited_arguments)
18
- multiline_args = replace_multiline_args_arguments(delimited_arguments)
15
+ def background?
16
+ false
17
+ end
19
18
 
20
- execute_twin(world, previous, visitor, row_line, name, *multiline_args)
19
+ def step_invocation
20
+ StepInvocation.new(self, @name, @multiline_arg, [])
21
21
  end
22
-
23
- def execute_as_new(world, previous, visitor, row_line)
24
- execute_twin(world, previous, visitor, row_line, @name, *@multiline_args)
22
+
23
+ def step_invocation_from_cells(cells)
24
+ matched_cells = matched_cells(cells)
25
+
26
+ delimited_arguments = delimit_argument_names(cells.to_hash)
27
+ name = replace_name_arguments(delimited_arguments)
28
+ multiline_arg = @multiline_arg.nil? ? nil : @multiline_arg.arguments_replaced(delimited_arguments)
29
+
30
+ StepInvocation.new(self, name, multiline_arg, matched_cells)
25
31
  end
26
32
 
27
33
  def accept(visitor)
28
- execute(visitor)
29
-
30
- if @status == :outline
31
- step_definition = find_first_name_and_step_definition_from_examples(visitor)
32
- else
33
- step_definition = @step_definition
34
- end
35
- visitor.visit_step_name(@keyword, @name, @status, step_definition, source_indent)
36
- @multiline_args.each do |multiline_arg|
37
- visitor.visit_multiline_arg(multiline_arg, @status)
38
- end
39
- @exception
34
+ # The only time a Step is visited is when it is in a ScenarioOutline.
35
+ # Otherwise it's always StepInvocation that gest visited instead.
36
+ visit_step_details(visitor, first_match(visitor), @multiline_arg, :skipped, nil, nil)
37
+ end
38
+
39
+ def visit_step_details(visitor, step_match, multiline_arg, status, exception, background)
40
+ visitor.visit_step_name(@keyword, step_match, status, source_indent, background)
41
+ visitor.visit_multiline_arg(@multiline_arg) if @multiline_arg
42
+ visitor.visit_exception(exception, status) if exception
40
43
  end
41
44
 
42
- def find_first_name_and_step_definition_from_examples(visitor)
43
- # @scenario is always a ScenarioOutline in this case
44
- @scenario.each_example_row do |cells|
45
+ def first_match(visitor)
46
+ # @feature_element is always a ScenarioOutline in this case
47
+ @feature_element.each_example_row do |cells|
45
48
  argument_hash = cells.to_hash
46
49
  delimited_arguments = delimit_argument_names(argument_hash)
47
50
  name = replace_name_arguments(delimited_arguments)
48
- step_definition = visitor.step_definition(name) rescue nil
49
- return step_definition if step_definition
51
+ step_match = visitor.step_mother.step_match(name, @name) rescue nil
52
+ return step_match if step_match
50
53
  end
51
- nil
54
+ NoStepMatch.new(self)
52
55
  end
53
56
 
54
57
  def to_sexp
55
- [:step, @line, @keyword, @name, *@multiline_args.map{|arg| arg.to_sexp}]
58
+ [:step, @line, @keyword, @name, (@multiline_arg.nil? ? nil : @multiline_arg.to_sexp)].compact
56
59
  end
57
60
 
58
- def at_lines?(lines)
59
- lines.empty? || lines.index(@line) || @multiline_args.detect{|a| a.at_lines?(lines)}
61
+ def matches_lines?(lines)
62
+ lines.index(@line) || (@multiline_arg && @multiline_arg.matches_lines?(lines))
60
63
  end
61
64
 
62
65
  def source_indent
63
- @scenario.source_indent(text_length)
66
+ @feature_element.source_indent(text_length)
64
67
  end
65
68
 
66
69
  def text_length
@@ -68,11 +71,11 @@ module Cucumber
68
71
  end
69
72
 
70
73
  def backtrace_line
71
- @backtrace_line ||= @scenario.backtrace_line("#{@keyword} #{@name}", @line) unless @scenario.nil?
74
+ @backtrace_line ||= @feature_element.backtrace_line("#{@keyword} #{@name}", @line) unless @feature_element.nil?
72
75
  end
73
76
 
74
- def file_line
75
- @file_line ||= @scenario.file_line(@line) unless @scenario.nil?
77
+ def file_colon_line
78
+ @file_colon_line ||= @feature_element.file_colon_line(@line) unless @feature_element.nil?
76
79
  end
77
80
 
78
81
  def actual_keyword
@@ -85,77 +88,35 @@ module Cucumber
85
88
 
86
89
  protected
87
90
 
91
+ # TODO: Remove when we use StepCollection everywhere
88
92
  def previous_step
89
- @scenario.previous_step(self)
93
+ @feature_element.previous_step(self)
90
94
  end
91
95
 
92
96
  private
93
97
 
94
- def execute(visitor)
95
- matched_args = []
96
- if @status.nil?
97
- begin
98
- @step_definition = visitor.step_definition(@name)
99
- matched_args = @step_definition.matched_args(@name)
100
- if @previous == :passed && !visitor.options[:dry_run]
101
- @world.__cucumber_current_step = self
102
- @step_definition.execute(@name, @world, *(matched_args + @multiline_args))
103
- @status = :passed
104
- else
105
- @status = :skipped
106
- end
107
- rescue Undefined => exception
108
- if visitor.options[:strict]
109
- exception.set_backtrace([])
110
- failed(exception)
111
- else
112
- @status = :undefined
113
- end
114
- rescue Pending => exception
115
- visitor.options[:strict] ? failed(exception) : @status = :pending
116
- rescue Exception => exception
117
- failed(exception)
118
- end
119
- @scenario.step_executed(self) if @scenario
98
+ def matched_cells(cells)
99
+ cells.select do |cell|
100
+ @name.index(delimited(cell.header_cell.value))
120
101
  end
121
- [self, @status, matched_args]
122
102
  end
123
103
 
124
- def execute_twin(world, previous, visitor, line, name, *multiline_args)
125
- # We'll create a new step and execute that
126
- step = Step.new(line, @keyword, name, *multiline_args)
127
- step.scenario = @scenario
128
- step.world = world
129
- step.previous = previous
130
- step.__send__(:execute, visitor)
104
+ def delimit_argument_names(argument_hash)
105
+ argument_hash.inject({}) { |h,(name,value)| h[delimited(name)] = value; h }
131
106
  end
132
107
 
133
- ARGUMENT_START = '<'
134
- ARGUMENT_END = '>'
135
-
136
- def delimit_argument_names(argument_hash)
137
- argument_hash.inject({}) { |h,(k,v)| h["#{ARGUMENT_START}#{k}#{ARGUMENT_END}"] = v; h }
108
+ def delimited(s)
109
+ "<#{s}>"
138
110
  end
139
111
 
140
112
  def replace_name_arguments(argument_hash)
141
113
  name_with_arguments_replaced = @name
142
114
  argument_hash.each do |name, value|
115
+ value ||= ''
143
116
  name_with_arguments_replaced = name_with_arguments_replaced.gsub(name, value) if value
144
117
  end
145
118
  name_with_arguments_replaced
146
119
  end
147
-
148
- def replace_multiline_args_arguments(arguments)
149
- @multiline_args.map do |arg|
150
- arg.arguments_replaced(arguments)
151
- end
152
- end
153
-
154
- def failed(exception)
155
- @status = :failed
156
- @exception = exception
157
- @exception.backtrace << backtrace_line unless backtrace_line.nil?
158
- end
159
120
  end
160
121
  end
161
122
  end
@@ -0,0 +1,66 @@
1
+ module Cucumber
2
+ module Ast
3
+ # Holds an Array of Step or StepDefinition
4
+ class StepCollection
5
+ include Enumerable
6
+
7
+ def initialize(steps)
8
+ @steps = steps
9
+ @steps.each{|step| step.step_collection = self}
10
+ end
11
+
12
+ def accept(visitor, &proc)
13
+ @steps.each do |step|
14
+ visitor.visit_step(step) if proc.nil? || proc.call(step)
15
+ end
16
+ end
17
+
18
+ def step_invocations(background = false)
19
+ StepCollection.new(@steps.map{ |step|
20
+ i = step.step_invocation
21
+ i.background = background
22
+ i
23
+ })
24
+ end
25
+
26
+ def step_invocations_from_cells(cells)
27
+ @steps.map{|step| step.step_invocation_from_cells(cells)}
28
+ end
29
+
30
+ # Duplicates this instance and adds +step_invocations+ to the end
31
+ def dup(step_invocations = [])
32
+ StepCollection.new(@steps + step_invocations)
33
+ end
34
+
35
+ def each(&proc)
36
+ @steps.each(&proc)
37
+ end
38
+
39
+ def previous_step(step)
40
+ i = @steps.index(step) || -1
41
+ @steps[i-1]
42
+ end
43
+
44
+ def matches_lines?(lines)
45
+ @steps.detect {|step| step.matches_lines?(lines)}
46
+ end
47
+
48
+ def empty?
49
+ @steps.empty?
50
+ end
51
+
52
+ def max_line_length(feature_element)
53
+ lengths = (@steps + [feature_element]).map{|e| e.text_length}
54
+ lengths.max
55
+ end
56
+
57
+ def exception
58
+ @exception ||= ((failed = @steps.detect {|step| step.exception}) && failed.exception)
59
+ end
60
+
61
+ def to_sexp
62
+ @steps.map{|step| step.to_sexp}
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,110 @@
1
+ module Cucumber
2
+ module Ast
3
+ class StepInvocation
4
+ attr_writer :step_collection, :background
5
+ attr_reader :name, :matched_cells, :status
6
+ attr_accessor :exception
7
+
8
+ def initialize(step, name, multiline_arg, matched_cells)
9
+ @step, @name, @multiline_arg, @matched_cells = step, name, multiline_arg, matched_cells
10
+ status!(:skipped)
11
+ end
12
+
13
+ def background?
14
+ @background
15
+ end
16
+
17
+ def skip_invoke!
18
+ @skip_invoke = true
19
+ end
20
+
21
+ def accept(visitor)
22
+ invoke(visitor.step_mother, visitor.options)
23
+ @step.visit_step_details(visitor, @step_match, @multiline_arg, @status, @exception, @background)
24
+ end
25
+
26
+ def invoke(step_mother, options)
27
+ find_step_match!(step_mother)
28
+ unless @skip_invoke || options[:dry_run] || exception || @step_collection.exception
29
+ @skip_invoke = true
30
+ begin
31
+ step_mother.current_world.__cucumber_current_step = self
32
+ @step_match.invoke(step_mother.current_world, @multiline_arg)
33
+ status!(:passed)
34
+ rescue Pending => e
35
+ failed(e, false)
36
+ status!(:pending)
37
+ rescue Undefined => e
38
+ failed(e, false)
39
+ status!(:undefined)
40
+ rescue Exception => e
41
+ failed(e, false)
42
+ status!(:failed)
43
+ end
44
+ end
45
+ end
46
+
47
+ def find_step_match!(step_mother)
48
+ return if @step_match
49
+ begin
50
+ @step_match = step_mother.step_match(@name)
51
+ rescue Undefined => e
52
+ failed(e, true)
53
+ status!(:undefined)
54
+ @step_match = NoStepMatch.new(@step)
55
+ rescue Ambiguous => e
56
+ failed(e, false)
57
+ status!(:failed)
58
+ @step_match = NoStepMatch.new(@step)
59
+ end
60
+ step_mother.step_visited(self)
61
+ end
62
+
63
+ def failed(exception, clear_backtrace)
64
+ @exception = exception
65
+ @exception.set_backtrace([]) if clear_backtrace
66
+ @exception.backtrace << @step.backtrace_line unless @step.backtrace_line.nil?
67
+ end
68
+
69
+ def status!(status)
70
+ @status = status
71
+ @multiline_arg.status = status if @multiline_arg
72
+ @matched_cells.each do |cell|
73
+ cell.status = status
74
+ end
75
+ end
76
+
77
+ def previous
78
+ @step_collection.previous_step(self)
79
+ end
80
+
81
+ def actual_keyword
82
+ if [Cucumber.keyword_hash['and'], Cucumber.keyword_hash['but']].index(@keyword) && previous
83
+ previous.actual_keyword
84
+ else
85
+ @step.keyword
86
+ end
87
+ end
88
+
89
+ def matches_lines?(lines)
90
+ @step.matches_lines?(lines)
91
+ end
92
+
93
+ def text_length
94
+ @step.text_length
95
+ end
96
+
97
+ def file_colon_line
98
+ @step.file_colon_line
99
+ end
100
+
101
+ def backtrace_line
102
+ @step.backtrace_line
103
+ end
104
+
105
+ def to_sexp
106
+ [:step_invocation, @step.line, @step.keyword, @name, (@multiline_arg.nil? ? nil : @multiline_arg.to_sexp)].compact
107
+ end
108
+ end
109
+ end
110
+ end
@@ -7,7 +7,7 @@ module Cucumber
7
7
  #
8
8
  # This gets parsed into a Table holding the values <tt>[['a', 'b'], ['c', 'd']]</tt>
9
9
  #
10
- class Table
10
+ class Table
11
11
  NULL_CONVERSIONS = Hash.new(lambda{ |cell_value| cell_value }).freeze
12
12
 
13
13
  attr_accessor :file
@@ -84,17 +84,23 @@ module Cucumber
84
84
  cells_rows.each(&proc)
85
85
  end
86
86
 
87
- def at_lines?(lines)
88
- cells_rows.detect { |row| row.at_lines?(lines) }
87
+ def matches_lines?(lines)
88
+ cells_rows.detect{|row| row.matches_lines?(lines)}
89
89
  end
90
90
 
91
- def accept(visitor, status)
91
+ def accept(visitor)
92
92
  cells_rows.each do |row|
93
- visitor.visit_table_row(row, status)
93
+ visitor.visit_table_row(row)
94
94
  end
95
95
  nil
96
96
  end
97
97
 
98
+ def status=(status)
99
+ cells_rows.each do |row|
100
+ row.status = status
101
+ end
102
+ end
103
+
98
104
  # For testing only
99
105
  def to_sexp #:nodoc:
100
106
  [:table, *cells_rows.map{|row| row.to_sexp}]
@@ -152,17 +158,24 @@ module Cucumber
152
158
  row.map do |cell|
153
159
  cell_with_replaced_args = cell
154
160
  arguments.each do |name, value|
155
- cell_with_replaced_args = value && !cell.nil? ? cell_with_replaced_args.gsub(name, value) : nil
161
+ if cell_with_replaced_args && cell_with_replaced_args.include?(name)
162
+ cell_with_replaced_args = value ? cell_with_replaced_args.gsub(name, value) : nil
163
+ end
156
164
  end
157
165
  cell_with_replaced_args
158
166
  end
159
167
  end
160
-
161
168
  Table.new(raw_with_replaced_args)
162
169
  end
163
170
 
164
- def at_lines?(lines)
165
- cells_rows.detect{|row| row.at_lines?(lines)}
171
+ def cells_rows
172
+ @rows ||= cell_matrix.map do |cell_row|
173
+ @cells_class.new(self, cell_row)
174
+ end
175
+ end
176
+
177
+ def header_cell(col)
178
+ cells_rows[0][col]
166
179
  end
167
180
 
168
181
  protected
@@ -183,12 +196,6 @@ module Cucumber
183
196
  columns[col].__send__(:width)
184
197
  end
185
198
 
186
- def cells_rows
187
- @rows ||= cell_matrix.map do |cell_row|
188
- @cells_class.new(self, cell_row)
189
- end
190
- end
191
-
192
199
  def columns
193
200
  @columns ||= cell_matrix.transpose.map do |cell_row|
194
201
  @cells_class.new(self, cell_row)
@@ -211,14 +218,19 @@ module Cucumber
211
218
  # Represents a row of cells or columns of cells
212
219
  class Cells
213
220
  include Enumerable
221
+ attr_reader :exception
214
222
 
215
223
  def initialize(table, cells)
216
224
  @table, @cells = table, cells
217
225
  end
218
226
 
219
- def accept(visitor, status)
227
+ def matches_lines?(lines)
228
+ lines.index(line)
229
+ end
230
+
231
+ def accept(visitor)
220
232
  each do |cell|
221
- visitor.visit_table_cell(cell, status)
233
+ visitor.visit_table_cell(cell)
222
234
  end
223
235
  nil
224
236
  end
@@ -244,8 +256,10 @@ module Cucumber
244
256
  @cells[0].line
245
257
  end
246
258
 
247
- def at_lines?(lines)
248
- lines.empty? || lines.index(line)
259
+ def status=(status)
260
+ each do |cell|
261
+ cell.status = status
262
+ end
249
263
  end
250
264
 
251
265
  private
@@ -265,13 +279,19 @@ module Cucumber
265
279
 
266
280
  class Cell
267
281
  attr_reader :value, :line
282
+ attr_writer :status
268
283
 
269
284
  def initialize(value, table, row, col, line)
270
285
  @value, @table, @row, @col, @line = value, table, row, col, line
286
+ @status = :passed
287
+ end
288
+
289
+ def accept(visitor)
290
+ visitor.visit_table_cell_value(@value, col_width, @status)
271
291
  end
272
292
 
273
- def accept(visitor, status)
274
- visitor.visit_table_cell_value(@value, col_width, status)
293
+ def header_cell
294
+ @table.header_cell(@col)
275
295
  end
276
296
 
277
297
  # For testing only