cucumber 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -12,10 +12,8 @@ doc
12
12
  *.swp
13
13
  target
14
14
  *.tmproj
15
- examples/self_test/tmp
16
15
  .#*
17
16
  .idea
18
17
  *.pyc
19
18
  rerun.txt
20
19
  ._*
21
- examples/self_test/tmp
@@ -1,3 +1,8 @@
1
+ == 0.7.2 (2010-05-03)
2
+
3
+ === Bugfixes
4
+ * REALLY add backwards compatibility fix (with deprecation warning) for legacy 0.6.4 formatters. (Aslak Hellesøy)
5
+
1
6
  == 0.7.1 (2010-05-03)
2
7
 
3
8
  === Bugfixes
@@ -60,7 +65,7 @@ Treetop is gone and replaced with Ragel. The new Ragel parser lives in the gherk
60
65
  Parse times are up to 100 times faster.
61
66
 
62
67
  === New Features
63
- * Upgraded Sinatra example to use Snatra 1.0 and Capybara. (Aslak Hellesøy)
68
+ * Upgraded Sinatra example to use Sinatra 1.0 and Capybara. (Aslak Hellesøy)
64
69
 
65
70
  === Changed Features
66
71
  * New i18n translations now have to be contributed to the gherkin project.
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 1
2
+ :patch: 2
3
3
  :build:
4
4
  :major: 0
5
5
  :minor: 7
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cucumber}
8
- s.version = "0.7.1"
8
+ s.version = "0.7.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Aslak Helles\303\270y"]
12
- s.date = %q{2010-05-03}
12
+ s.date = %q{2010-05-04}
13
13
  s.default_executable = %q{cucumber}
14
14
  s.description = %q{Behaviour Driven Development with elegance and joy}
15
15
  s.email = %q{cukes@googlegroups.com}
@@ -541,7 +541,7 @@ Gem::Specification.new do |s|
541
541
 
542
542
  (::) U P G R A D I N G (::)
543
543
 
544
- Thank you for installing cucumber-0.7.1.
544
+ Thank you for installing cucumber-0.7.2.
545
545
  Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading
546
546
  for important information about this release. Happy cuking!
547
547
 
@@ -51,8 +51,12 @@ Feature: Custom Formatter
51
51
  And a file named "features/f.feature" with:
52
52
  """
53
53
  Feature: We like old cukes
54
- Scenario: just print me
54
+ Scenario Outline: just print me
55
55
  Given this step works
56
+
57
+ Examples: print me too
58
+ |foo|
59
+ |bar|
56
60
  """
57
61
  And a file named "features/step_definitions/steps.rb" with:
58
62
  """
@@ -74,19 +78,28 @@ Feature: Custom Formatter
74
78
  def scenario_name(keyword, name, file_colon_line, source_indent)
75
79
  @io.puts "#{keyword} #{name}"
76
80
  end
81
+
82
+ def examples_name(keyword, name)
83
+ @io.puts "#{keyword} #{name}"
84
+ end
77
85
  end
78
86
  end
79
87
  """
80
88
  When I run cucumber features/f.feature --format Legacy::Formator
81
89
  Then STDERR should be
82
90
  """
83
- Legacy::Formator is using a deprecated formatter API. The signature has changed to :feature_name(keyword, name) # no trailing : in keyword
84
- Legacy::Formator is using a deprecated formatter API. The :scenario_name method does not receive trailing : in keyword
91
+ Legacy::Formator is using a deprecated formatter API. Starting with Cucumber 0.7.0 the signatures
92
+ that have changed are:
93
+ feature_name(keyword, name) # Two arguments. The keyword argument will not contain a colon.
94
+ scenario_name(keyword, name, file_colon_line, source_indent) # The keyword argument will not contain a colon.
95
+ examples_name(keyword, name) # The keyword argument will not contain a colon.
96
+
85
97
 
86
98
  """
87
99
  Then it should pass with
88
100
  """
89
101
  Feature: We like old cukes
90
- Scenario: just print me
102
+ Scenario Outline: just print me
103
+ Examples: print me too
91
104
 
92
105
  """
@@ -171,27 +171,48 @@ module Cucumber
171
171
  def send_to_all(message, *args)
172
172
  @listeners.each do |listener|
173
173
  if listener.respond_to?(message)
174
- if listener.respond_to?(:feature_name) &&
175
- (listener.method(:feature_name) rescue false) &&
176
- listener.method(:feature_name).arity == 1
177
- # Legacy
178
- case message.to_sym
179
- when :feature_name
180
- warn("#{listener.class} is using a deprecated formatter API. The signature has changed to :feature_name(keyword, name) # no trailing : in keyword")
181
- listener.feature_name("#{args[0]}: #{args[1]}")
182
- when :scenario_name, :examples_name
183
- warn("#{listener.class} is using a deprecated formatter API. The :scenario_name method does not receive trailing : in keyword")
184
- listener.__send__(message, "#{args[0]}:", args[1], args[2], args[3])
185
- else
186
- listener.__send__(message, *args)
187
- end
174
+ if legacy_listener?(listener)
175
+ warn_legacy(listener)
176
+ legacy_invoke(listener, message, *args)
188
177
  else
189
178
  listener.__send__(message, *args)
190
179
  end
191
180
  end
192
181
  end
193
182
  end
194
-
183
+
184
+ def legacy_listener?(listener)
185
+ listener.respond_to?(:feature_name) &&
186
+ (listener.method(:feature_name) rescue false) &&
187
+ listener.method(:feature_name).arity == 1
188
+ end
189
+
190
+ def warn_legacy(listener)
191
+ @warned_listeners ||= []
192
+ unless @warned_listeners.index(listener)
193
+ warn("#{listener.class} is using a deprecated formatter API. Starting with Cucumber 0.7.0 the signatures\n" +
194
+ "that have changed are:\n" +
195
+ " feature_name(keyword, name) # Two arguments. The keyword argument will not contain a colon.\n" +
196
+ " scenario_name(keyword, name, file_colon_line, source_indent) # The keyword argument will not contain a colon.\n" +
197
+ " examples_name(keyword, name) # The keyword argument will not contain a colon.\n"
198
+ )
199
+ end
200
+ @warned_listeners << listener
201
+ end
202
+
203
+ def legacy_invoke(listener, message, *args)
204
+ case message.to_sym
205
+ when :feature_name
206
+ listener.feature_name("#{args[0]}: #{args[1]}")
207
+ when :scenario_name, :examples_name
208
+ args_with_colon = args.dup
209
+ args_with_colon[0] += ':'
210
+ listener.__send__(message, *args_with_colon)
211
+ else
212
+ listener.__send__(message, *args)
213
+ end
214
+ end
215
+
195
216
  def extract_method_name_from(call_stack)
196
217
  call_stack[0].match(/in `(.*)'/).captures[0]
197
218
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 1
9
- version: 0.7.1
8
+ - 2
9
+ version: 0.7.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Aslak Helles\xC3\xB8y"
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-03 00:00:00 +02:00
17
+ date: 2010-05-04 00:00:00 +02:00
18
18
  default_executable: cucumber
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -720,7 +720,7 @@ post_install_message: |+
720
720
 
721
721
  (::) U P G R A D I N G (::)
722
722
 
723
- Thank you for installing cucumber-0.7.1.
723
+ Thank you for installing cucumber-0.7.2.
724
724
  Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading
725
725
  for important information about this release. Happy cuking!
726
726