cucumber 1.2.5 → 1.3.0

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 (110) hide show
  1. checksums.yaml +14 -6
  2. data/.ruby-gemset +1 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +1 -0
  5. data/.yardopts +1 -0
  6. data/CONTRIBUTING.md +2 -2
  7. data/History.md +38 -2
  8. data/bin/cucumber +2 -11
  9. data/cucumber.gemspec +3 -3
  10. data/cucumber.yml +5 -1
  11. data/examples/test_unit/Gemfile +4 -0
  12. data/examples/test_unit/features/step_definitions/test_unit_steps.rb +1 -4
  13. data/examples/watir/README.textile +2 -2
  14. data/examples/watir/features/support/env.rb +10 -7
  15. data/features/.cucumber/stepdefs.json +747 -1354
  16. data/features/assertions.feature +6 -2
  17. data/features/background.feature +3 -0
  18. data/features/backtraces.feature +3 -3
  19. data/features/before_hook.feature +43 -0
  20. data/features/bootstrap.feature +14 -2
  21. data/features/custom_formatter.feature +1 -1
  22. data/features/drb_server_integration.feature +3 -3
  23. data/features/formatter_callbacks.feature +2 -2
  24. data/features/formatter_step_file_colon_line.feature +1 -1
  25. data/features/html_formatter.feature +52 -1
  26. data/features/json_formatter.feature +93 -7
  27. data/features/load_path.feature +14 -0
  28. data/features/nested_steps.feature +75 -3
  29. data/features/nested_steps_i18n.feature +36 -0
  30. data/features/pretty_formatter.feature +31 -0
  31. data/features/progress_formatter.feature +31 -0
  32. data/features/raketask.feature +51 -0
  33. data/features/rerun_formatter.feature +1 -1
  34. data/features/stats_formatters.feature +17 -14
  35. data/features/step_definitions/cucumber_steps.rb +6 -4
  36. data/features/support/env.rb +31 -4
  37. data/features/support/feature_factory.rb +17 -0
  38. data/features/tagged_hooks.feature +37 -195
  39. data/features/transforms.feature +15 -15
  40. data/gem_tasks/cucumber.rake +2 -0
  41. data/gem_tasks/yard.rake +10 -6
  42. data/legacy_features/README.md +14 -0
  43. data/legacy_features/language_help.feature +3 -1
  44. data/legacy_features/report_called_undefined_steps.feature +1 -0
  45. data/legacy_features/snippets_when_using_star_keyword.feature +1 -0
  46. data/legacy_features/support/env.rb +4 -0
  47. data/lib/cucumber/ast/background.rb +35 -35
  48. data/lib/cucumber/ast/empty_background.rb +33 -0
  49. data/lib/cucumber/ast/examples.rb +5 -2
  50. data/lib/cucumber/ast/feature.rb +24 -35
  51. data/lib/cucumber/ast/features.rb +4 -1
  52. data/lib/cucumber/ast/has_steps.rb +9 -17
  53. data/lib/cucumber/ast/location.rb +41 -0
  54. data/lib/cucumber/ast/scenario.rb +37 -50
  55. data/lib/cucumber/ast/scenario_outline.rb +62 -49
  56. data/lib/cucumber/ast/step.rb +23 -27
  57. data/lib/cucumber/ast/step_collection.rb +16 -0
  58. data/lib/cucumber/ast/step_invocation.rb +4 -1
  59. data/lib/cucumber/ast/tree_walker.rb +7 -0
  60. data/lib/cucumber/cli/configuration.rb +15 -3
  61. data/lib/cucumber/cli/main.rb +24 -11
  62. data/lib/cucumber/cli/options.rb +24 -16
  63. data/lib/cucumber/configuration.rb +4 -0
  64. data/lib/cucumber/core_ext/disable_mini_and_test_unit_autorun.rb +10 -34
  65. data/lib/cucumber/core_ext/instance_exec.rb +4 -1
  66. data/lib/cucumber/core_ext/proc.rb +2 -0
  67. data/lib/cucumber/feature_file.rb +5 -12
  68. data/lib/cucumber/formatter/console.rb +10 -0
  69. data/lib/cucumber/formatter/gherkin_formatter_adapter.rb +4 -4
  70. data/lib/cucumber/formatter/html.rb +7 -42
  71. data/lib/cucumber/formatter/interceptor.rb +4 -0
  72. data/lib/cucumber/formatter/json_pretty.rb +0 -4
  73. data/lib/cucumber/formatter/junit.rb +8 -2
  74. data/lib/cucumber/formatter/pretty.rb +5 -1
  75. data/lib/cucumber/formatter/progress.rb +4 -0
  76. data/lib/cucumber/formatter/unicode.rb +12 -25
  77. data/lib/cucumber/formatter/usage.rb +7 -2
  78. data/lib/cucumber/js_support/js_snippets.rb +1 -1
  79. data/lib/cucumber/load_path.rb +13 -0
  80. data/lib/cucumber/parser/gherkin_builder.rb +237 -81
  81. data/lib/cucumber/platform.rb +1 -1
  82. data/lib/cucumber/py_support/py_language.rb +1 -1
  83. data/lib/cucumber/rake/task.rb +5 -1
  84. data/lib/cucumber/rb_support/rb_language.rb +20 -19
  85. data/lib/cucumber/rb_support/rb_world.rb +63 -21
  86. data/lib/cucumber/rb_support/snippet.rb +108 -0
  87. data/lib/cucumber/runtime.rb +1 -0
  88. data/lib/cucumber/runtime/support_code.rb +2 -2
  89. data/lib/cucumber/unit.rb +11 -0
  90. data/lib/cucumber/wire_support/wire_language.rb +1 -1
  91. data/spec/cucumber/ast/background_spec.rb +13 -6
  92. data/spec/cucumber/ast/feature_factory.rb +20 -10
  93. data/spec/cucumber/ast/features_spec.rb +51 -0
  94. data/spec/cucumber/ast/scenario_outline_spec.rb +13 -7
  95. data/spec/cucumber/ast/step_spec.rb +6 -4
  96. data/spec/cucumber/cli/configuration_spec.rb +34 -1
  97. data/spec/cucumber/cli/main_spec.rb +36 -26
  98. data/spec/cucumber/cli/options_spec.rb +28 -19
  99. data/spec/cucumber/core_ext/proc_spec.rb +13 -1
  100. data/spec/cucumber/formatter/interceptor_spec.rb +8 -0
  101. data/spec/cucumber/formatter/junit_spec.rb +33 -0
  102. data/spec/cucumber/formatter/pretty_spec.rb +391 -0
  103. data/spec/cucumber/rb_support/rb_language_spec.rb +21 -50
  104. data/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb +2 -4
  105. data/spec/cucumber/rb_support/snippet_spec.rb +128 -0
  106. data/spec/cucumber/step_match_spec.rb +2 -6
  107. metadata +62 -113
  108. data/.rvmrc +0 -1
  109. data/features/hooks.feature +0 -59
  110. data/legacy_features/call_steps_from_stepdefs.feature +0 -154
@@ -9,6 +9,10 @@ module Cucumber
9
9
  @steps.each{|step| step.step_collection = self}
10
10
  end
11
11
 
12
+ def inspect
13
+ @steps.map { |s| [s.class, s.object_id] }.join(', ')
14
+ end
15
+
12
16
  def accept(visitor)
13
17
  return if Cucumber.wants_to_quit
14
18
  @steps.each do |step|
@@ -24,10 +28,18 @@ module Cucumber
24
28
  })
25
29
  end
26
30
 
31
+ def skip_invoke!
32
+ @steps.each{|step_invocation| step_invocation.skip_invoke!}
33
+ end
34
+
27
35
  def step_invocations_from_cells(cells)
28
36
  @steps.map{|step| step.step_invocation_from_cells(cells)}
29
37
  end
30
38
 
39
+ def +(step_invocations)
40
+ dup(step_invocations)
41
+ end
42
+
31
43
  # Duplicates this instance and adds +step_invocations+ to the end
32
44
  def dup(step_invocations = [])
33
45
  StepCollection.new(@steps + step_invocations)
@@ -68,6 +80,10 @@ module Cucumber
68
80
  :passed
69
81
  end
70
82
 
83
+ def length
84
+ @steps.length
85
+ end
86
+
71
87
  def to_sexp
72
88
  @steps.map{|step| step.to_sexp}
73
89
  end
@@ -107,6 +107,9 @@ module Cucumber
107
107
 
108
108
  # This constant is appended to by Cuke4Duke. Do not change its name
109
109
  BACKTRACE_FILTER_PATTERNS = [/vendor\/rails|lib\/cucumber|bin\/cucumber:|lib\/rspec|gems\/|minitest|test\/unit/]
110
+ if(Cucumber::JRUBY)
111
+ BACKTRACE_FILTER_PATTERNS << /org\/jruby/
112
+ end
110
113
  PWD_PATTERN = /#{Regexp.escape(Dir.pwd)}\//m
111
114
 
112
115
  # This is to work around double ":in " segments in JRuby backtraces. JRuby bug?
@@ -178,7 +181,7 @@ module Cucumber
178
181
  end
179
182
 
180
183
  def language
181
- @step.language
184
+ @step.language || raise("Language is required on #{@step}")
182
185
  end
183
186
 
184
187
  def gherkin_statement
@@ -9,6 +9,13 @@ module Cucumber
9
9
  @runtime, @listeners, @configuration = runtime, listeners, configuration
10
10
  end
11
11
 
12
+ def execute(scenario, skip_hooks)
13
+ runtime.with_hooks(scenario, skip_hooks) do
14
+ scenario.skip_invoke! if scenario.failed?
15
+ visit_steps(scenario.steps)
16
+ end
17
+ end
18
+
12
19
  def visit_features(features)
13
20
  broadcast(features) do
14
21
  features.accept(self)
@@ -68,6 +68,10 @@ module Cucumber
68
68
  @options[:dotcucumber]
69
69
  end
70
70
 
71
+ def snippet_type
72
+ @options[:snippet_type] || :regexp
73
+ end
74
+
71
75
  def build_tree_walker(runtime)
72
76
  Ast::TreeWalker.new(runtime, formatters(runtime), self)
73
77
  end
@@ -106,7 +110,7 @@ module Cucumber
106
110
  end
107
111
 
108
112
  def feature_files
109
- potential_feature_files = paths.map do |path|
113
+ potential_feature_files = with_default_features_path(paths).map do |path|
110
114
  path = path.gsub(/\\/, '/') # In case we're on windows. Globs don't work with backslashes.
111
115
  path = path.chomp('/')
112
116
  if File.directory?(path)
@@ -123,7 +127,9 @@ module Cucumber
123
127
  end
124
128
 
125
129
  def feature_dirs
126
- paths.map { |f| File.directory?(f) ? f : File.dirname(f) }.uniq
130
+ dirs = paths.map { |f| File.directory?(f) ? f : File.dirname(f) }.uniq
131
+ dirs.delete('.') unless paths.include?('.')
132
+ with_default_features_path(dirs)
127
133
  end
128
134
 
129
135
  def log
@@ -152,9 +158,14 @@ module Cucumber
152
158
  end
153
159
 
154
160
  def paths
155
- @options[:paths].empty? ? ['features'] : @options[:paths]
161
+ @options[:paths]
156
162
  end
157
163
  private
164
+ def with_default_features_path(paths)
165
+ return ['features'] if paths.empty?
166
+ paths
167
+ end
168
+
158
169
 
159
170
  def formatters(runtime)
160
171
  # TODO: We should remove the autoformat functionality. That
@@ -193,6 +204,7 @@ module Cucumber
193
204
  def arrange_formats
194
205
  @options[:formats] << ['pretty', @out_stream] if @options[:formats].empty?
195
206
  @options[:formats] = @options[:formats].sort_by{|f| f[1] == @out_stream ? -1 : 1}
207
+ @options[:formats].uniq!
196
208
  streams = @options[:formats].map { |(_, stream)| stream }
197
209
  if streams != streams.uniq
198
210
  raise "All but one formatter must use --out, only one can print to each stream (or STDOUT)"
@@ -21,11 +21,15 @@ module Cucumber
21
21
  end
22
22
  end
23
23
 
24
- def initialize(args, out_stream = STDOUT, error_stream = STDERR)
25
- @args = args
26
- @out_stream = out_stream
27
-
28
- @error_stream = error_stream
24
+ def initialize(args, stdin=STDIN, out=STDOUT, err=STDERR, kernel=Kernel)
25
+ raise "args can't be nil" unless args
26
+ raise "out can't be nil" unless out
27
+ raise "err can't be nil" unless err
28
+ raise "kernel can't be nil" unless kernel
29
+ @args = args
30
+ @out = out
31
+ @err = err
32
+ @kernel = kernel
29
33
  @configuration = nil
30
34
  end
31
35
 
@@ -42,16 +46,25 @@ module Cucumber
42
46
 
43
47
  runtime.run!
44
48
  runtime.write_stepdefs_json
45
- runtime.results.failure? || Cucumber.wants_to_quit
49
+ failure = runtime.results.failure? || Cucumber.wants_to_quit
50
+ @kernel.exit(failure ? 1 : 0)
46
51
  rescue ProfilesNotDefinedError, YmlLoadError, ProfileNotFound => e
47
- @error_stream.puts e.message
48
- true
52
+ @err.puts(e.message)
53
+ rescue SystemExit => e
54
+ @kernel.exit(e.status)
55
+ rescue Errno::EACCES, Errno::ENOENT => e
56
+ @err.puts("#{e.message} (#{e.class})")
57
+ @kernel.exit(1)
58
+ rescue Exception => e
59
+ @err.puts("#{e.message} (#{e.class})")
60
+ @err.puts(e.backtrace.join("\n"))
61
+ @kernel.exit(1)
49
62
  end
50
63
 
51
64
  def configuration
52
65
  return @configuration if @configuration
53
66
 
54
- @configuration = Configuration.new(@out_stream, @error_stream)
67
+ @configuration = Configuration.new(@out, @err)
55
68
  @configuration.parse!(@args)
56
69
  Cucumber.logger = @configuration.log
57
70
  @configuration
@@ -61,10 +74,10 @@ module Cucumber
61
74
 
62
75
  def run_drb_client
63
76
  return false unless configuration.drb?
64
- @drb_output = DRbClient.run(@args, @error_stream, @out_stream, configuration.drb_port)
77
+ @drb_output = DRbClient.run(@args, @err, @out, configuration.drb_port)
65
78
  true
66
79
  rescue DRbClientError => e
67
- @error_stream.puts "WARNING: #{e.message} Running features locally:"
80
+ @err.puts "WARNING: #{e.message} Running features locally:"
68
81
  end
69
82
 
70
83
  def trap_interrupt
@@ -1,5 +1,6 @@
1
1
  require 'cucumber/cli/profile_loader'
2
2
  require 'cucumber/formatter/ansicolor'
3
+ require 'cucumber/rb_support/rb_language'
3
4
 
4
5
  module Cucumber
5
6
  module Cli
@@ -46,7 +47,8 @@ module Cucumber
46
47
  OPTIONS_WITH_ARGS = ['-r', '--require', '--i18n', '-f', '--format', '-o', '--out',
47
48
  '-t', '--tags', '-n', '--name', '-e', '--exclude',
48
49
  PROFILE_SHORT_FLAG, PROFILE_LONG_FLAG,
49
- '-a', '--autoformat', '-l', '--lines', '--port']
50
+ '-a', '--autoformat', '-l', '--lines', '--port',
51
+ '-I', '--snippet-type']
50
52
 
51
53
  def self.parse(args, out_stream, error_stream, options = {})
52
54
  new(out_stream, error_stream, options).parse!(args)
@@ -57,10 +59,11 @@ module Cucumber
57
59
  @error_stream = error_stream
58
60
 
59
61
  @default_profile = options[:default_profile]
60
- @skip_profile_information = options[:skip_profile_information]
61
62
  @profiles = []
62
63
  @overridden_paths = []
63
64
  @options = default_options
65
+ @profile_loader = options[:profile_loader]
66
+ @options[:skip_profile_information] = options[:skip_profile_information]
64
67
 
65
68
  @quiet = @disable_profile_loading = nil
66
69
  end
@@ -238,6 +241,12 @@ module Cucumber
238
241
  opts.on("-i", "--no-snippets", "Don't print snippets for pending steps.") do
239
242
  @options[:snippets] = false
240
243
  end
244
+ opts.on("-I", "--snippet-type TYPE",
245
+ "Use different snippet type (Default: regexp). Available types:",
246
+ *Cucumber::RbSupport::RbLanguage.cli_snippet_type_options) do |v|
247
+ @options[:snippet_type] = v.to_sym
248
+ end
249
+
241
250
  opts.on("-q", "--quiet", "Alias for --no-snippets --no-source.") do
242
251
  @quiet = true
243
252
  end
@@ -293,7 +302,6 @@ module Cucumber
293
302
  @options[:paths] = @args.dup #whatver is left over
294
303
 
295
304
  merge_profiles
296
- print_profile_information
297
305
 
298
306
  self
299
307
  end
@@ -343,11 +351,20 @@ module Cucumber
343
351
  @profiles << @default_profile if default_profile_should_be_used?
344
352
 
345
353
  @profiles.each do |profile|
346
- profile_args = profile_loader.args_from(profile)
347
- reverse_merge(
348
- Options.parse(profile_args, @out_stream, @error_stream, :skip_profile_information => true)
349
- )
354
+ merge_with_profile(profile)
350
355
  end
356
+
357
+ @options[:profiles] = @profiles
358
+ end
359
+
360
+ def merge_with_profile(profile)
361
+ profile_args = profile_loader.args_from(profile)
362
+ profile_options = Options.parse(
363
+ profile_args, @out_stream, @error_stream,
364
+ :skip_profile_information => true,
365
+ :profile_loader => profile_loader
366
+ )
367
+ reverse_merge(profile_options)
351
368
  end
352
369
 
353
370
  def default_profile_should_be_used?
@@ -402,15 +419,6 @@ module Cucumber
402
419
  Kernel.exit(0)
403
420
  end
404
421
 
405
- def print_profile_information
406
- return if @skip_profile_information || @profiles.empty?
407
- profiles_sentence = ''
408
- profiles_sentence = @profiles.size == 1 ? @profiles.first :
409
- "#{@profiles[0...-1].join(', ')} and #{@profiles.last}"
410
-
411
- @out_stream.puts "Using the #{profiles_sentence} profile#{'s' if @profiles.size> 1}..."
412
- end
413
-
414
422
  def default_options
415
423
  {
416
424
  :strict => false,
@@ -38,6 +38,10 @@ module Cucumber
38
38
  @options[:autoload_code_paths]
39
39
  end
40
40
 
41
+ def snippet_type
42
+ @options[:snippet_type]
43
+ end
44
+
41
45
  private
42
46
 
43
47
  def default_options
@@ -1,39 +1,15 @@
1
- # Why: http://groups.google.com/group/cukes/browse_thread/thread/5682d41436e235d7
2
- begin
3
- require 'minitest/unit'
4
- # Don't attempt to monkeypatch if the require succeeded but didn't
5
- # define the actual module.
6
- #
7
- # https://github.com/cucumber/cucumber/pull/93
8
- # http://youtrack.jetbrains.net/issue/TW-17414
9
- if defined?(MiniTest::Unit)
10
- class MiniTest::Unit
11
- class << self
12
- @@installed_at_exit = true
13
- end
14
-
15
- def run(*)
16
- 0
17
- end
18
- end
19
- end
20
- rescue LoadError => ignore
21
- end
22
-
23
- # Do the same for Test::Unit
24
1
  begin
25
2
  require 'test/unit'
26
- # Don't attempt to monkeypatch if the require succeeded but didn't
27
- # define the actual module.
28
- #
29
- # https://github.com/cucumber/cucumber/pull/93
30
- # http://youtrack.jetbrains.net/issue/TW-17414
31
- if defined?(Test::Unit)
32
- module Test::Unit
33
- def self.run?
34
- true
35
- end
36
- end
3
+
4
+ if defined?(Test::Unit::AutoRunner.need_auto_run?)
5
+ # For test-unit gem >= 2.4.9
6
+ Test::Unit::AutoRunner.need_auto_run = false
7
+ elsif defined?(Test::Unit.run?)
8
+ # For test-unit gem < 2.4.9
9
+ Test::Unit.run = true
10
+ elsif defined?(Test::Unit::Runner)
11
+ # For test/unit bundled in Ruby >= 1.9.3
12
+ Test::Unit::Runner.module_eval("@@stop_auto_run = true")
37
13
  end
38
14
  rescue LoadError => ignore
39
15
  end
@@ -87,8 +87,11 @@ class Object #:nodoc:
87
87
  else
88
88
  backtrace[replacement_line].gsub!(/`.*'/, "`#{pseudo_method}'") if pseudo_method
89
89
  end
90
- backtrace[replacement_line+1..-1] = nil
91
90
 
91
+ depth = backtrace.count { |line| line == instance_exec_invocation_line }
92
+ end_pos = depth > 1 ? instance_exec_pos : -1
93
+
94
+ backtrace[replacement_line+1..end_pos] = nil
92
95
  backtrace.compact!
93
96
  else
94
97
  # This happens with rails, because they screw up the backtrace
@@ -1,4 +1,5 @@
1
1
  # Proc extension to get more location info out of a proc
2
+ require 'cucumber/platform'
2
3
  class Proc #:nodoc:
3
4
  PROC_PATTERN = /[\d\w]+@(.+):(\d+).*>/
4
5
  PWD = Dir.pwd
@@ -16,6 +17,7 @@ class Proc #:nodoc:
16
17
  path, line = *to_s.match(PROC_PATTERN)[1..2]
17
18
  path = File.expand_path(path)
18
19
  pwd = File.expand_path(PWD)
20
+ pwd.force_encoding(path.encoding) unless Cucumber::RUBY_1_8_7
19
21
  if path.index(pwd)
20
22
  path = path[pwd.length+1..-1]
21
23
  elsif path =~ /.*\/gems\/(.*\.rb)$/
@@ -22,24 +22,21 @@ module Cucumber
22
22
  end
23
23
  end
24
24
 
25
- # Parses a file and returns a Cucumber::Ast
25
+ # Parses a file and returns a Cucumber::Ast::Feature
26
26
  # If +configuration_filters+ contains any filters, the result will
27
27
  # be filtered.
28
28
  def parse(configuration_filters, tag_counts)
29
29
  filters = @lines || configuration_filters
30
30
 
31
- builder = Cucumber::Parser::GherkinBuilder.new
31
+ builder = Cucumber::Parser::GherkinBuilder.new(@path)
32
32
  filter_formatter = filters.empty? ? builder : Gherkin::Formatter::FilterFormatter.new(builder, filters)
33
33
  tag_count_formatter = Gherkin::Formatter::TagCountFormatter.new(filter_formatter, tag_counts)
34
34
  parser = Gherkin::Parser::Parser.new(tag_count_formatter, true, "root", false)
35
35
 
36
36
  begin
37
37
  parser.parse(source, @path, 0)
38
- ast = builder.ast
39
- return nil if ast.nil? # Filter caused nothing to match
40
- ast.language = parser.i18n_language
41
- ast.file = @path
42
- ast
38
+ builder.language = parser.i18n_language
39
+ builder.result
43
40
  rescue Gherkin::Lexer::LexingError, Gherkin::Parser::ParseError => e
44
41
  e.message.insert(0, "#{@path}: ")
45
42
  raise e
@@ -65,11 +62,7 @@ module Cucumber
65
62
  raise e
66
63
  rescue Errno::ENOENT => e
67
64
  # special-case opening features, because this could be a new user:
68
- if(@path == 'features')
69
- STDERR.puts("You don't have a 'features' directory. Please create one to get started.",
70
- "See http://cukes.info/ for more information.")
71
- exit 1
72
- end
65
+ e.message << ". Please create a #{@path} directory to get started."
73
66
  raise e
74
67
  end
75
68
  end
@@ -192,6 +192,16 @@ module Cucumber
192
192
  @delayed_messages = []
193
193
  end
194
194
 
195
+ def print_profile_information
196
+ return if @options[:skip_profile_information] || @options[:profiles].nil? || @options[:profiles].empty?
197
+ profiles = @options[:profiles]
198
+ profiles_sentence = ''
199
+ profiles_sentence = profiles.size == 1 ? profiles.first :
200
+ "#{profiles[0...-1].join(', ')} and #{profiles.last}"
201
+
202
+ @io.puts "Using the #{profiles_sentence} profile#{'s' if profiles.size> 1}..."
203
+ end
204
+
195
205
  private
196
206
 
197
207
  FORMATS = Hash.new{ |hash, format| hash[format] = method(format).to_proc }
@@ -6,9 +6,9 @@ module Cucumber
6
6
  # Adapts Cucumber formatter events to Gherkin formatter events
7
7
  # This class will disappear when Cucumber is based on Gherkin's model.
8
8
  class GherkinFormatterAdapter
9
- def initialize(gherkin_formatter, print_emtpy_match)
9
+ def initialize(gherkin_formatter, print_empty_match)
10
10
  @gf = gherkin_formatter
11
- @print_emtpy_match = print_emtpy_match
11
+ @print_empty_match = print_empty_match
12
12
  end
13
13
 
14
14
  def before_feature(feature)
@@ -36,7 +36,7 @@ module Cucumber
36
36
 
37
37
  def before_step(step)
38
38
  @gf.step(step.gherkin_statement)
39
- if @print_emtpy_match
39
+ if @print_empty_match
40
40
  if(@outline)
41
41
  match = Gherkin::Formatter::Model::Match.new(step.gherkin_statement.outline_args, nil)
42
42
  else
@@ -51,7 +51,7 @@ module Cucumber
51
51
  arguments = step_match.step_arguments.map{|a| Gherkin::Formatter::Argument.new(a.offset, a.val)}
52
52
  location = step_match.file_colon_line
53
53
  match = Gherkin::Formatter::Model::Match.new(arguments, location)
54
- if @print_emtpy_match
54
+ if @print_empty_match
55
55
  # Trick the formatter to believe that's what was printed previously so we get arg highlights on #result
56
56
  @gf.instance_variable_set('@match', match)
57
57
  else