aslakhellesoy-cucumber 0.2.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/History.txt +13 -5
  2. data/Manifest.txt +49 -47
  3. data/config/hoe.rb +2 -2
  4. data/examples/tickets/features/246.feature +4 -0
  5. data/examples/tickets/features/step_definitons/246_steps.rb +3 -0
  6. data/gem_tasks/rspec.rake +3 -2
  7. data/lib/cucumber/formatters/unicode.rb +2 -0
  8. data/lib/cucumber/languages.yml +43 -0
  9. data/lib/cucumber/parser.rb +2 -7
  10. data/lib/cucumber/parser/feature.rb +34 -39
  11. data/lib/cucumber/parser/feature.tt +1 -1
  12. data/lib/cucumber/parser/i18n.tt +4 -0
  13. data/lib/cucumber/step_definition.rb +9 -12
  14. data/lib/cucumber/version.rb +2 -2
  15. data/rails_generators/cucumber/templates/paths.rb +2 -1
  16. data/{spec → specs}/cucumber/ast/background_spec.rb +0 -0
  17. data/{spec → specs}/cucumber/ast/feature_factory.rb +0 -0
  18. data/{spec → specs}/cucumber/ast/feature_spec.rb +0 -0
  19. data/{spec → specs}/cucumber/ast/py_string_spec.rb +0 -0
  20. data/{spec → specs}/cucumber/ast/scenario_outline_spec.rb +0 -0
  21. data/{spec → specs}/cucumber/ast/scenario_spec.rb +0 -0
  22. data/{spec → specs}/cucumber/ast/step_collection_spec.rb +0 -0
  23. data/{spec → specs}/cucumber/ast/step_spec.rb +0 -0
  24. data/{spec → specs}/cucumber/ast/table_spec.rb +0 -0
  25. data/{spec → specs}/cucumber/ast/tags_spec.rb +0 -0
  26. data/{spec → specs}/cucumber/broadcaster_spec.rb +0 -0
  27. data/{spec → specs}/cucumber/cli/configuration_spec.rb +0 -0
  28. data/{spec → specs}/cucumber/cli/main_spec.rb +0 -0
  29. data/{spec → specs}/cucumber/core_ext/proc_spec.rb +1 -1
  30. data/{spec → specs}/cucumber/core_ext/string_spec.rb +0 -0
  31. data/{spec → specs}/cucumber/formatter/ansicolor_spec.rb +0 -0
  32. data/{spec → specs}/cucumber/formatter/color_io_spec.rb +0 -0
  33. data/{spec → specs}/cucumber/formatter/html/cucumber.css +0 -0
  34. data/{spec → specs}/cucumber/formatter/html/cucumber.js +0 -0
  35. data/{spec → specs}/cucumber/formatter/html/index.html +0 -0
  36. data/{spec → specs}/cucumber/formatter/html/jquery-1.3.min.js +0 -0
  37. data/{spec → specs}/cucumber/formatter/html/jquery.uitableedit.js +0 -0
  38. data/{spec → specs}/cucumber/formatters/profile_formatter_spec.rb +0 -0
  39. data/{spec → specs}/cucumber/parser/feature_parser_spec.rb +0 -0
  40. data/{spec → specs}/cucumber/parser/table_parser_spec.rb +0 -0
  41. data/{spec → specs}/cucumber/rails/stubs/mini_rails.rb +0 -0
  42. data/{spec → specs}/cucumber/rails/stubs/test_help.rb +0 -0
  43. data/{spec → specs}/cucumber/rails/world_spec.rb +0 -0
  44. data/{spec → specs}/cucumber/sell_cucumbers.feature +0 -0
  45. data/{spec → specs}/cucumber/step_definition_spec.rb +8 -0
  46. data/{spec → specs}/cucumber/step_mother_spec.rb +4 -4
  47. data/{spec → specs}/cucumber/treetop_parser/empty_feature.feature +0 -0
  48. data/{spec → specs}/cucumber/treetop_parser/empty_scenario.feature +0 -0
  49. data/{spec → specs}/cucumber/treetop_parser/empty_scenario_outline.feature +0 -0
  50. data/{spec → specs}/cucumber/treetop_parser/fit_scenario.feature +0 -0
  51. data/{spec → specs}/cucumber/treetop_parser/given_scenario.feature +0 -0
  52. data/{spec → specs}/cucumber/treetop_parser/invalid_scenario_outlines.feature +0 -0
  53. data/{spec → specs}/cucumber/treetop_parser/multiline_steps.feature +0 -0
  54. data/{spec → specs}/cucumber/treetop_parser/multiple_tables.feature +0 -0
  55. data/{spec → specs}/cucumber/treetop_parser/scenario_outline.feature +0 -0
  56. data/{spec → specs}/cucumber/treetop_parser/spaces.feature +0 -0
  57. data/{spec → specs}/cucumber/treetop_parser/test_dos.feature +0 -0
  58. data/{spec → specs}/cucumber/treetop_parser/with_comments.feature +0 -0
  59. data/{spec → specs}/cucumber/treetop_parser/with_tags.feature +0 -0
  60. data/{spec → specs}/cucumber/world/pending_spec.rb +0 -0
  61. data/{spec → specs}/spec.opts +0 -0
  62. data/{spec → specs}/spec_helper.rb +0 -0
  63. metadata +55 -52
@@ -1,14 +1,22 @@
1
- == 0.2.3 (In Git)
1
+ == 0.2.3 2009-03-30
2
+
3
+ This release sports 4 updated languages, slightly better help with snippets if you "quote" arguments
4
+ in your steps. Windows/JRuby users can enjoy colours and you get some more sugar with Tables.
2
5
 
3
6
  === New features
4
7
  * Added new Then /^I should be on (.+)$/ do |page_name| step (Grant Hollingworth)
5
8
  * Use skipped_param color for examples table header (#266 Eugene Naydanov)
6
9
  * Added new Cucumber::Ast::Table#rows_hash method (Torbjørn Vatn)
7
- * Windows/JRuby users can now enjoy colourful output (via http://aslakhellesoy.github.com/ansicolor) (Aslak Hellesøy)
10
+ * Windows/JRuby users can now enjoy colourful output (via http://github.com/aslakhellesoy/ansicolor) (#166 Aslak Hellesøy)
8
11
  * Ambiguous step errors hint about --guess (unless --guess already on) (Aslak Hellesøy)
9
- * Updated language for Dutch (Bart Zonneveld)
10
- * Updated language for Italian (Alessandro Baroni)
11
- * Updated language for Japanese (KAKUTANI Shintaro)
12
+ * Added translation for Slovak (Ahmed Al Hafoudh)
13
+ * Updated translation for Dutch (Bart Zonneveld)
14
+ * Updated translation for Italian (Alessandro Baroni)
15
+ * Updated translation for Japanese (KAKUTANI Shintaro)
16
+
17
+ === Bugfixes
18
+ * Fixed step name after step keyword without space (#265 Aslak Hellesøy)
19
+ * Backtrace is back in HTML reports
12
20
 
13
21
  == 0.2.2 2009-03-25
14
22
 
@@ -170,10 +170,12 @@ examples/tickets/features/177/3.feature
170
170
  examples/tickets/features/180.feature
171
171
  examples/tickets/features/236.feature
172
172
  examples/tickets/features/241.feature
173
+ examples/tickets/features/246.feature
173
174
  examples/tickets/features/248.feature
174
175
  examples/tickets/features/lib/eatting_machine.rb
175
176
  examples/tickets/features/lib/pantry.rb
176
177
  examples/tickets/features/scenario_outline.feature
178
+ examples/tickets/features/step_definitons/246_steps.rb
177
179
  examples/tickets/features/step_definitons/248_steps.rb
178
180
  examples/tickets/features/step_definitons/scenario_outline_steps.rb
179
181
  examples/tickets/features/step_definitons/tickets_steps.rb
@@ -276,50 +278,50 @@ rails_generators/feature/USAGE
276
278
  rails_generators/feature/feature_generator.rb
277
279
  rails_generators/feature/templates/feature.erb
278
280
  rails_generators/feature/templates/steps.erb
279
- spec/cucumber/ast/background_spec.rb
280
- spec/cucumber/ast/feature_factory.rb
281
- spec/cucumber/ast/feature_spec.rb
282
- spec/cucumber/ast/py_string_spec.rb
283
- spec/cucumber/ast/scenario_outline_spec.rb
284
- spec/cucumber/ast/scenario_spec.rb
285
- spec/cucumber/ast/step_collection_spec.rb
286
- spec/cucumber/ast/step_spec.rb
287
- spec/cucumber/ast/table_spec.rb
288
- spec/cucumber/ast/tags_spec.rb
289
- spec/cucumber/broadcaster_spec.rb
290
- spec/cucumber/cli/configuration_spec.rb
291
- spec/cucumber/cli/main_spec.rb
292
- spec/cucumber/core_ext/proc_spec.rb
293
- spec/cucumber/core_ext/string_spec.rb
294
- spec/cucumber/formatter/ansicolor_spec.rb
295
- spec/cucumber/formatter/color_io_spec.rb
296
- spec/cucumber/formatter/html/cucumber.css
297
- spec/cucumber/formatter/html/cucumber.js
298
- spec/cucumber/formatter/html/index.html
299
- spec/cucumber/formatter/html/jquery-1.3.min.js
300
- spec/cucumber/formatter/html/jquery.uitableedit.js
301
- spec/cucumber/formatters/profile_formatter_spec.rb
302
- spec/cucumber/parser/feature_parser_spec.rb
303
- spec/cucumber/parser/table_parser_spec.rb
304
- spec/cucumber/rails/stubs/mini_rails.rb
305
- spec/cucumber/rails/stubs/test_help.rb
306
- spec/cucumber/rails/world_spec.rb
307
- spec/cucumber/sell_cucumbers.feature
308
- spec/cucumber/step_definition_spec.rb
309
- spec/cucumber/step_mother_spec.rb
310
- spec/cucumber/treetop_parser/empty_feature.feature
311
- spec/cucumber/treetop_parser/empty_scenario.feature
312
- spec/cucumber/treetop_parser/empty_scenario_outline.feature
313
- spec/cucumber/treetop_parser/fit_scenario.feature
314
- spec/cucumber/treetop_parser/given_scenario.feature
315
- spec/cucumber/treetop_parser/invalid_scenario_outlines.feature
316
- spec/cucumber/treetop_parser/multiline_steps.feature
317
- spec/cucumber/treetop_parser/multiple_tables.feature
318
- spec/cucumber/treetop_parser/scenario_outline.feature
319
- spec/cucumber/treetop_parser/spaces.feature
320
- spec/cucumber/treetop_parser/test_dos.feature
321
- spec/cucumber/treetop_parser/with_comments.feature
322
- spec/cucumber/treetop_parser/with_tags.feature
323
- spec/cucumber/world/pending_spec.rb
324
- spec/spec.opts
325
- spec/spec_helper.rb
281
+ specs/cucumber/ast/background_spec.rb
282
+ specs/cucumber/ast/feature_factory.rb
283
+ specs/cucumber/ast/feature_spec.rb
284
+ specs/cucumber/ast/py_string_spec.rb
285
+ specs/cucumber/ast/scenario_outline_spec.rb
286
+ specs/cucumber/ast/scenario_spec.rb
287
+ specs/cucumber/ast/step_collection_spec.rb
288
+ specs/cucumber/ast/step_spec.rb
289
+ specs/cucumber/ast/table_spec.rb
290
+ specs/cucumber/ast/tags_spec.rb
291
+ specs/cucumber/broadcaster_spec.rb
292
+ specs/cucumber/cli/configuration_spec.rb
293
+ specs/cucumber/cli/main_spec.rb
294
+ specs/cucumber/core_ext/proc_spec.rb
295
+ specs/cucumber/core_ext/string_spec.rb
296
+ specs/cucumber/formatter/ansicolor_spec.rb
297
+ specs/cucumber/formatter/color_io_spec.rb
298
+ specs/cucumber/formatter/html/cucumber.css
299
+ specs/cucumber/formatter/html/cucumber.js
300
+ specs/cucumber/formatter/html/index.html
301
+ specs/cucumber/formatter/html/jquery-1.3.min.js
302
+ specs/cucumber/formatter/html/jquery.uitableedit.js
303
+ specs/cucumber/formatters/profile_formatter_spec.rb
304
+ specs/cucumber/parser/feature_parser_spec.rb
305
+ specs/cucumber/parser/table_parser_spec.rb
306
+ specs/cucumber/rails/stubs/mini_rails.rb
307
+ specs/cucumber/rails/stubs/test_help.rb
308
+ specs/cucumber/rails/world_spec.rb
309
+ specs/cucumber/sell_cucumbers.feature
310
+ specs/cucumber/step_definition_spec.rb
311
+ specs/cucumber/step_mother_spec.rb
312
+ specs/cucumber/treetop_parser/empty_feature.feature
313
+ specs/cucumber/treetop_parser/empty_scenario.feature
314
+ specs/cucumber/treetop_parser/empty_scenario_outline.feature
315
+ specs/cucumber/treetop_parser/fit_scenario.feature
316
+ specs/cucumber/treetop_parser/given_scenario.feature
317
+ specs/cucumber/treetop_parser/invalid_scenario_outlines.feature
318
+ specs/cucumber/treetop_parser/multiline_steps.feature
319
+ specs/cucumber/treetop_parser/multiple_tables.feature
320
+ specs/cucumber/treetop_parser/scenario_outline.feature
321
+ specs/cucumber/treetop_parser/spaces.feature
322
+ specs/cucumber/treetop_parser/test_dos.feature
323
+ specs/cucumber/treetop_parser/with_comments.feature
324
+ specs/cucumber/treetop_parser/with_tags.feature
325
+ specs/cucumber/world/pending_spec.rb
326
+ specs/spec.opts
327
+ specs/spec_helper.rb
@@ -60,8 +60,8 @@ $hoe = Hoe.new(GEM_NAME, VERS) do |p|
60
60
  #p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
61
61
  p.extra_deps = [
62
62
  ['term-ansicolor', '>= 1.0.3'],
63
- ['treetop', '>= 1.2.4'],
64
- ['polyglot', '>= 0.2.4'], # Remove this when Treetop no longer loads polyglot by default.
63
+ ['treetop', '>= 1.2.5'],
64
+ ['polyglot', '>= 0.2.5'], # Remove this when Treetop no longer loads polyglot by default.
65
65
  ['diff-lcs', '>= 1.1.2'],
66
66
  ['builder', '>= 2.1.2']
67
67
  ]
@@ -0,0 +1,4 @@
1
+ Feature: https://rspec.lighthouseapp.com/projects/16211/tickets/246-distorted-console-output-for-slightly-complicated-step-regexp-match
2
+
3
+ Scenario: See "No Record(s) Found" for Zero Existing
4
+ Given no public holiday exists in the system
@@ -0,0 +1,3 @@
1
+ Given /^no ([a-z]+(?: [a-z]+)*) exists in the system$/ do |resource|
2
+ resource.should == "public holiday"
3
+ end
@@ -29,9 +29,10 @@ if require_spec
29
29
 
30
30
  desc "Run the Cucumber specs"
31
31
  Spec::Rake::SpecTask.new do |t|
32
- t.spec_opts = ['--options', "spec/spec.opts"]
33
- t.spec_files = FileList['spec/**/*_spec.rb']
32
+ t.spec_opts = ['--options', "specs/spec.opts"]
33
+ t.spec_files = FileList['specs/**/*_spec.rb']
34
34
  t.rcov = ENV['RCOV']
35
35
  t.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/}
36
+ t.verbose = true
36
37
  end
37
38
  end
@@ -0,0 +1,2 @@
1
+ # This is for backwards compatibility
2
+ require 'cucumber/formatter/unicode'
@@ -20,6 +20,7 @@
20
20
  then: Then
21
21
  and: And
22
22
  but: But
23
+ space_after_keyword: true
23
24
 
24
25
  # Please help us keeping the languages below uptodate. The parsers for a language
25
26
  # that is missing a keyword will expect the English word until the missing word(s)
@@ -41,6 +42,7 @@
41
42
  then: اذاً|ثم
42
43
  and: و
43
44
  but: لكن
45
+ space_after_keyword: true
44
46
  "cy":
45
47
  name: Welsh
46
48
  native: Cymraeg
@@ -53,6 +55,7 @@
53
55
  then: Yna
54
56
  and: A
55
57
  but: Ond
58
+ space_after_keyword: true
56
59
  "cz":
57
60
  name: Czech
58
61
  native: Česky
@@ -67,6 +70,7 @@
67
70
  then: Pak
68
71
  and: A
69
72
  but: Ale
73
+ space_after_keyword: true
70
74
  "da":
71
75
  name: Danish
72
76
  native: dansk
@@ -81,6 +85,7 @@
81
85
  then: Så
82
86
  and: Og
83
87
  but: Men
88
+ space_after_keyword: true
84
89
  "de":
85
90
  name: German
86
91
  native: Deutsch
@@ -95,6 +100,7 @@
95
100
  then: Dann
96
101
  and: Und
97
102
  but: Aber
103
+ space_after_keyword: true
98
104
  "en-au":
99
105
  name: Australian
100
106
  native: Australian
@@ -109,6 +115,7 @@
109
115
  then: Ya gotta
110
116
  and: N
111
117
  but: Cept
118
+ space_after_keyword: true
112
119
  "en-lol":
113
120
  name: LOLCAT
114
121
  native: LOLCAT
@@ -123,6 +130,7 @@
123
130
  then: DEN
124
131
  and: AN
125
132
  but: BUT
133
+ space_after_keyword: true
126
134
  "en-tx":
127
135
  name: Texan
128
136
  native: Texan
@@ -137,6 +145,7 @@
137
145
  then: Then y'all
138
146
  and: And y'all
139
147
  but: But y'all
148
+ space_after_keyword: true
140
149
  "es":
141
150
  name: Spanish
142
151
  native: español
@@ -151,6 +160,7 @@
151
160
  then: Entonces
152
161
  and: Y
153
162
  but: Pero
163
+ space_after_keyword: true
154
164
  "et":
155
165
  name: Estonian
156
166
  native: eesti keel
@@ -165,6 +175,7 @@
165
175
  then: Siis
166
176
  and: Ja
167
177
  but: Kuid
178
+ space_after_keyword: true
168
179
  "fi":
169
180
  name: Finnish
170
181
  native: suomi
@@ -179,6 +190,7 @@
179
190
  then: Niin
180
191
  and: Ja
181
192
  but: Mutta
193
+ space_after_keyword: true
182
194
  "fr":
183
195
  name: French
184
196
  native: français
@@ -193,6 +205,7 @@
193
205
  then: Alors
194
206
  and: Et
195
207
  but: Mais
208
+ space_after_keyword: true
196
209
  "id":
197
210
  name: Indonesian
198
211
  native: Bahasa Indonesia
@@ -207,6 +220,7 @@
207
220
  then: Maka
208
221
  and: Dan
209
222
  but: Tapi
223
+ space_after_keyword: true
210
224
  "it":
211
225
  name: Italian
212
226
  native: italiano
@@ -221,6 +235,7 @@
221
235
  then: Allora
222
236
  and: E
223
237
  but: Ma
238
+ space_after_keyword: true
224
239
  "ja":
225
240
  name: Japanese
226
241
  native: 日本語
@@ -235,6 +250,7 @@
235
250
  then: ならば
236
251
  and: かつ
237
252
  but: しかし
253
+ space_after_keyword: false
238
254
  "lt":
239
255
  name: Lithuanian
240
256
  native: lietuvių kalba
@@ -247,6 +263,7 @@
247
263
  then: Tada
248
264
  and: Ir
249
265
  but: Bet
266
+ space_after_keyword: true
250
267
  "nl":
251
268
  name: Dutch
252
269
  native: Nederlands
@@ -261,6 +278,7 @@
261
278
  then: Dan
262
279
  and: En
263
280
  but: Maar
281
+ space_after_keyword: true
264
282
  "no":
265
283
  name: Norwegian
266
284
  native: norsk
@@ -275,6 +293,7 @@
275
293
  then: Så
276
294
  and: Og
277
295
  but: Men
296
+ space_after_keyword: true
278
297
  "pl":
279
298
  name: Polish
280
299
  native: polski
@@ -286,6 +305,7 @@
286
305
  then: Wtedy
287
306
  and: Oraz
288
307
  but: Ale
308
+ space_after_keyword: true
289
309
  "pt":
290
310
  name: Portuguese
291
311
  native: português
@@ -300,6 +320,7 @@
300
320
  then: Então
301
321
  and: E
302
322
  but: Mas
323
+ space_after_keyword: true
303
324
  "ro":
304
325
  name: Romanian
305
326
  native: română
@@ -311,6 +332,7 @@
311
332
  then: Atunci
312
333
  and: Si
313
334
  but: Dar
335
+ space_after_keyword: true
314
336
  "ro2":
315
337
  name: Romanian (diacritical)
316
338
  native: română (diacritical)
@@ -322,6 +344,7 @@
322
344
  then: Atunci
323
345
  and: Și
324
346
  but: Dar
347
+ space_after_keyword: true
325
348
  "ru":
326
349
  name: Russian
327
350
  native: русский
@@ -336,6 +359,7 @@
336
359
  then: То
337
360
  and: И|К тому же
338
361
  but: Но|А
362
+ space_after_keyword: true
339
363
  "se":
340
364
  name: Swedish
341
365
  native: Svenska
@@ -350,6 +374,22 @@
350
374
  then: Så
351
375
  and: Och
352
376
  but: Men
377
+ space_after_keyword: true
378
+ "sk":
379
+ name: Slovak
380
+ native: Slovensky
381
+ encoding: UTF-8
382
+ feature: Požiadavka
383
+ background: Pozadie
384
+ scenario: Scenár
385
+ scenario_outline: Náčrt Scenáru
386
+ examples: Príklady
387
+ given: Pokiaľ
388
+ when: Keď
389
+ then: Tak
390
+ and: A
391
+ but: Ale
392
+ space_after_keyword: true
353
393
  "zh-CN":
354
394
  name: Chinese simplified
355
395
  native: 简体中文
@@ -364,6 +404,7 @@
364
404
  then: 那么
365
405
  and: 而且
366
406
  but: 但是
407
+ space_after_keyword: false
367
408
  "zh-TW":
368
409
  name: Chinese traditional
369
410
  native: 繁體中文
@@ -378,6 +419,7 @@
378
419
  then: 那麼
379
420
  and: 而且|並且
380
421
  but: 但是
422
+ space_after_keyword: false
381
423
  "ko":
382
424
  name: Korean
383
425
  native: 한국어
@@ -392,3 +434,4 @@
392
434
  then: 그러면
393
435
  and: 그리고
394
436
  but: 하지만
437
+ space_after_keyword: false
@@ -13,12 +13,6 @@ module Cucumber
13
13
  #
14
14
  # The AST classes are defined in the Cucumber::Ast module.
15
15
  module Parser
16
- translator = Module.new do
17
- def keywordz(key)
18
- 'Scenario'
19
- end
20
- end
21
-
22
16
  def self.load_parser(keywords)
23
17
  Loader.new(keywords)
24
18
  end
@@ -34,7 +28,8 @@ module Cucumber
34
28
  require 'cucumber/parser/feature'
35
29
  end
36
30
 
37
- def keywords(key)
31
+ def keywords(key, raw=false)
32
+ return @keywords[key] if raw
38
33
  values = @keywords[key].split('|')
39
34
  values.map{|value| "'#{value}'"}.join(" / ")
40
35
  end
@@ -870,6 +870,10 @@ module Cucumber
870
870
  elements[2]
871
871
  end
872
872
 
873
+ def keyword_space
874
+ elements[3]
875
+ end
876
+
873
877
  def name
874
878
  elements[4]
875
879
  end
@@ -920,60 +924,51 @@ module Cucumber
920
924
  r4 = _nt_step_keyword
921
925
  s0 << r4
922
926
  if r4
923
- s5, i5 = [], index
924
- loop do
925
- r6 = _nt_space
926
- if r6
927
- s5 << r6
928
- else
929
- break
930
- end
931
- end
932
- r5 = SyntaxNode.new(input, i5...index, s5)
927
+ r5 = _nt_keyword_space
933
928
  s0 << r5
934
929
  if r5
935
- r7 = _nt_line_to_eol
936
- s0 << r7
937
- if r7
938
- i8 = index
939
- s9, i9 = [], index
930
+ r6 = _nt_line_to_eol
931
+ s0 << r6
932
+ if r6
933
+ i7 = index
934
+ s8, i8 = [], index
940
935
  loop do
941
- r10 = _nt_eol
942
- if r10
943
- s9 << r10
936
+ r9 = _nt_eol
937
+ if r9
938
+ s8 << r9
944
939
  else
945
940
  break
946
941
  end
947
942
  end
948
- if s9.empty?
949
- self.index = i9
950
- r9 = nil
943
+ if s8.empty?
944
+ self.index = i8
945
+ r8 = nil
951
946
  else
952
- r9 = SyntaxNode.new(input, i9...index, s9)
947
+ r8 = SyntaxNode.new(input, i8...index, s8)
953
948
  end
954
- if r9
955
- r8 = r9
949
+ if r8
950
+ r7 = r8
956
951
  else
957
- r11 = _nt_eof
958
- if r11
959
- r8 = r11
952
+ r10 = _nt_eof
953
+ if r10
954
+ r7 = r10
960
955
  else
961
- self.index = i8
962
- r8 = nil
956
+ self.index = i7
957
+ r7 = nil
963
958
  end
964
959
  end
965
- s0 << r8
966
- if r8
967
- r13 = _nt_multiline_arg
968
- if r13
969
- r12 = r13
960
+ s0 << r7
961
+ if r7
962
+ r12 = _nt_multiline_arg
963
+ if r12
964
+ r11 = r12
970
965
  else
971
- r12 = SyntaxNode.new(input, index...index)
966
+ r11 = SyntaxNode.new(input, index...index)
972
967
  end
973
- s0 << r12
974
- if r12
975
- r14 = _nt_white
976
- s0 << r14
968
+ s0 << r11
969
+ if r11
970
+ r13 = _nt_white
971
+ s0 << r13
977
972
  end
978
973
  end
979
974
  end
@@ -121,7 +121,7 @@ module Cucumber
121
121
  end
122
122
 
123
123
  rule step
124
- comment space* step_keyword space* name:line_to_eol (eol+ / eof) multi:multiline_arg? white {
124
+ comment space* step_keyword keyword_space name:line_to_eol (eol+ / eof) multi:multiline_arg? white {
125
125
  def build
126
126
  if multi.respond_to?(:build)
127
127
  Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value.strip, multi.build)
@@ -22,6 +22,10 @@ module Cucumber
22
22
  (<%= keywords('but') %>)
23
23
  end
24
24
 
25
+ rule keyword_space
26
+ <%= keywords('space_after_keyword', true) ? 'space+' : 'space*' %>
27
+ end
28
+
25
29
  rule examples_keyword
26
30
  (<%= keywords('examples') %>) ':'?
27
31
  end
@@ -56,23 +56,20 @@ module Cucumber
56
56
  # end
57
57
  #
58
58
  class StepDefinition
59
+ PARAM_PATTERN = /"([^\"]*)"/
60
+ ESCAPED_PARAM_PATTERN = '"([^\\"]*)"'
61
+
59
62
  def self.snippet_text(step_keyword, step_name)
60
63
  escaped = Regexp.escape(step_name).gsub('\ ', ' ').gsub('/', '\/')
61
- param_pattern = /"([^\"]*)"/
64
+ escaped = escaped.gsub(PARAM_PATTERN, ESCAPED_PARAM_PATTERN)
62
65
 
63
- match = escaped.match(param_pattern)
64
- if match
65
- n = 0
66
- block_args = match.captures.map do |a|
67
- n += 1
68
- "arg#{n}"
69
- end
70
- block_arg_string = " |#{block_args.join(", ")}|"
71
- else
72
- block_arg_string = ""
66
+ n = 0
67
+ block_args = escaped.scan(ESCAPED_PARAM_PATTERN).map do |a|
68
+ n += 1
69
+ "arg#{n}"
73
70
  end
71
+ block_arg_string = block_args.empty? ? "" : " |#{block_args.join(", ")}|"
74
72
 
75
- escaped = escaped.gsub(param_pattern, '"([^\\"]*)"')
76
73
  "#{step_keyword} /^#{escaped}$/ do#{block_arg_string}\n pending\nend"
77
74
  end
78
75
 
@@ -2,8 +2,8 @@ module Cucumber #:nodoc:
2
2
  class VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 2
6
- PATCH = 2 # Set to nil for official release
5
+ TINY = 3
6
+ PATCH = nil # Set to nil for official release
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
9
9
  end
@@ -8,7 +8,8 @@ module NavigationHelpers
8
8
  # Add more page name => path mappings here
9
9
 
10
10
  else
11
- raise "Can't find mapping from \"#{page_name}\" to a path."
11
+ raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
12
+ "Now, go and add a mapping in features/support/paths.rb"
12
13
  end
13
14
  end
14
15
  end
@@ -32,6 +32,6 @@ describe Proc do
32
32
 
33
33
  it "should remove extraneous path info for file" do
34
34
  proc = lambda {|a,b|}
35
- proc.file_colon_line.should == "spec/cucumber/core_ext/proc_spec.rb:34"
35
+ proc.file_colon_line.should == "specs/cucumber/core_ext/proc_spec.rb:34"
36
36
  end
37
37
  end
@@ -82,6 +82,14 @@ module Cucumber
82
82
  })
83
83
  end
84
84
 
85
+ it "should recognise several quoted words in name and make according regexp and args" do
86
+ StepDefinition.snippet_text('Given', 'A "first" and "second" arg').should == unindented(%{
87
+ Given /^A "([^\\"]*)" and "([^\\"]*)" arg$/ do |arg1, arg2|
88
+ pending
89
+ end
90
+ })
91
+ end
92
+
85
93
  it "should not use quote group when there are no quotes" do
86
94
  StepDefinition.snippet_text('Given', 'A first arg').should == unindented(%{
87
95
  Given /^A first arg$/ do
@@ -27,8 +27,8 @@ module Cucumber
27
27
  @step_mother.step_match("Three blind mice")
28
28
  end.should raise_error(Ambiguous, %{Ambiguous match of "Three blind mice":
29
29
 
30
- spec/cucumber/step_mother_spec.rb:23:in `/Three (.*) mice/'
31
- spec/cucumber/step_mother_spec.rb:24:in `/Three blind (.*)/'
30
+ specs/cucumber/step_mother_spec.rb:23:in `/Three (.*) mice/'
31
+ specs/cucumber/step_mother_spec.rb:24:in `/Three blind (.*)/'
32
32
 
33
33
  You can run again with --guess to make Cucumber be more smart about it
34
34
  })
@@ -43,8 +43,8 @@ You can run again with --guess to make Cucumber be more smart about it
43
43
  @step_mother.step_match("Three cute mice")
44
44
  end.should raise_error(Ambiguous, %{Ambiguous match of "Three cute mice":
45
45
 
46
- spec/cucumber/step_mother_spec.rb:39:in `/Three (.*) mice/'
47
- spec/cucumber/step_mother_spec.rb:40:in `/Three cute (.*)/'
46
+ specs/cucumber/step_mother_spec.rb:39:in `/Three (.*) mice/'
47
+ specs/cucumber/step_mother_spec.rb:40:in `/Three cute (.*)/'
48
48
 
49
49
  })
50
50
  end
File without changes
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aslakhellesoy-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Aslak Helles\xC3\xB8y"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-28 00:00:00 -07:00
12
+ date: 2009-03-30 00:00:00 -07:00
13
13
  default_executable: cucumber
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.2.4
33
+ version: 1.2.5
34
34
  version:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: polyglot
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 0.2.4
43
+ version: 0.2.5
44
44
  version:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: diff-lcs
@@ -70,7 +70,7 @@ dependencies:
70
70
  requirements:
71
71
  - - ">="
72
72
  - !ruby/object:Gem::Version
73
- version: 1.8.3
73
+ version: 1.11.0
74
74
  version:
75
75
  description: Executable Feature scenarios
76
76
  email:
@@ -257,10 +257,12 @@ files:
257
257
  - examples/tickets/features/180.feature
258
258
  - examples/tickets/features/236.feature
259
259
  - examples/tickets/features/241.feature
260
+ - examples/tickets/features/246.feature
260
261
  - examples/tickets/features/248.feature
261
262
  - examples/tickets/features/lib/eatting_machine.rb
262
263
  - examples/tickets/features/lib/pantry.rb
263
264
  - examples/tickets/features/scenario_outline.feature
265
+ - examples/tickets/features/step_definitons/246_steps.rb
264
266
  - examples/tickets/features/step_definitons/248_steps.rb
265
267
  - examples/tickets/features/step_definitons/scenario_outline_steps.rb
266
268
  - examples/tickets/features/step_definitons/tickets_steps.rb
@@ -333,6 +335,7 @@ files:
333
335
  - lib/cucumber/formatter/rerun.rb
334
336
  - lib/cucumber/formatter/unicode.rb
335
337
  - lib/cucumber/formatter/usage.rb
338
+ - lib/cucumber/formatters/unicode.rb
336
339
  - lib/cucumber/languages.yml
337
340
  - lib/cucumber/parser.rb
338
341
  - lib/cucumber/parser/basic.rb
@@ -362,53 +365,53 @@ files:
362
365
  - rails_generators/feature/feature_generator.rb
363
366
  - rails_generators/feature/templates/feature.erb
364
367
  - rails_generators/feature/templates/steps.erb
365
- - spec/cucumber/ast/background_spec.rb
366
- - spec/cucumber/ast/feature_factory.rb
367
- - spec/cucumber/ast/feature_spec.rb
368
- - spec/cucumber/ast/py_string_spec.rb
369
- - spec/cucumber/ast/scenario_outline_spec.rb
370
- - spec/cucumber/ast/scenario_spec.rb
371
- - spec/cucumber/ast/step_collection_spec.rb
372
- - spec/cucumber/ast/step_spec.rb
373
- - spec/cucumber/ast/table_spec.rb
374
- - spec/cucumber/ast/tags_spec.rb
375
- - spec/cucumber/broadcaster_spec.rb
376
- - spec/cucumber/cli/configuration_spec.rb
377
- - spec/cucumber/cli/main_spec.rb
378
- - spec/cucumber/core_ext/proc_spec.rb
379
- - spec/cucumber/core_ext/string_spec.rb
380
- - spec/cucumber/formatter/ansicolor_spec.rb
381
- - spec/cucumber/formatter/color_io_spec.rb
382
- - spec/cucumber/formatter/html/cucumber.css
383
- - spec/cucumber/formatter/html/cucumber.js
384
- - spec/cucumber/formatter/html/index.html
385
- - spec/cucumber/formatter/html/jquery-1.3.min.js
386
- - spec/cucumber/formatter/html/jquery.uitableedit.js
387
- - spec/cucumber/formatters/profile_formatter_spec.rb
388
- - spec/cucumber/parser/feature_parser_spec.rb
389
- - spec/cucumber/parser/table_parser_spec.rb
390
- - spec/cucumber/rails/stubs/mini_rails.rb
391
- - spec/cucumber/rails/stubs/test_help.rb
392
- - spec/cucumber/rails/world_spec.rb
393
- - spec/cucumber/sell_cucumbers.feature
394
- - spec/cucumber/step_definition_spec.rb
395
- - spec/cucumber/step_mother_spec.rb
396
- - spec/cucumber/treetop_parser/empty_feature.feature
397
- - spec/cucumber/treetop_parser/empty_scenario.feature
398
- - spec/cucumber/treetop_parser/empty_scenario_outline.feature
399
- - spec/cucumber/treetop_parser/fit_scenario.feature
400
- - spec/cucumber/treetop_parser/given_scenario.feature
401
- - spec/cucumber/treetop_parser/invalid_scenario_outlines.feature
402
- - spec/cucumber/treetop_parser/multiline_steps.feature
403
- - spec/cucumber/treetop_parser/multiple_tables.feature
404
- - spec/cucumber/treetop_parser/scenario_outline.feature
405
- - spec/cucumber/treetop_parser/spaces.feature
406
- - spec/cucumber/treetop_parser/test_dos.feature
407
- - spec/cucumber/treetop_parser/with_comments.feature
408
- - spec/cucumber/treetop_parser/with_tags.feature
409
- - spec/cucumber/world/pending_spec.rb
410
- - spec/spec.opts
411
- - spec/spec_helper.rb
368
+ - specs/cucumber/ast/background_spec.rb
369
+ - specs/cucumber/ast/feature_factory.rb
370
+ - specs/cucumber/ast/feature_spec.rb
371
+ - specs/cucumber/ast/py_string_spec.rb
372
+ - specs/cucumber/ast/scenario_outline_spec.rb
373
+ - specs/cucumber/ast/scenario_spec.rb
374
+ - specs/cucumber/ast/step_collection_spec.rb
375
+ - specs/cucumber/ast/step_spec.rb
376
+ - specs/cucumber/ast/table_spec.rb
377
+ - specs/cucumber/ast/tags_spec.rb
378
+ - specs/cucumber/broadcaster_spec.rb
379
+ - specs/cucumber/cli/configuration_spec.rb
380
+ - specs/cucumber/cli/main_spec.rb
381
+ - specs/cucumber/core_ext/proc_spec.rb
382
+ - specs/cucumber/core_ext/string_spec.rb
383
+ - specs/cucumber/formatter/ansicolor_spec.rb
384
+ - specs/cucumber/formatter/color_io_spec.rb
385
+ - specs/cucumber/formatter/html/cucumber.css
386
+ - specs/cucumber/formatter/html/cucumber.js
387
+ - specs/cucumber/formatter/html/index.html
388
+ - specs/cucumber/formatter/html/jquery-1.3.min.js
389
+ - specs/cucumber/formatter/html/jquery.uitableedit.js
390
+ - specs/cucumber/formatters/profile_formatter_spec.rb
391
+ - specs/cucumber/parser/feature_parser_spec.rb
392
+ - specs/cucumber/parser/table_parser_spec.rb
393
+ - specs/cucumber/rails/stubs/mini_rails.rb
394
+ - specs/cucumber/rails/stubs/test_help.rb
395
+ - specs/cucumber/rails/world_spec.rb
396
+ - specs/cucumber/sell_cucumbers.feature
397
+ - specs/cucumber/step_definition_spec.rb
398
+ - specs/cucumber/step_mother_spec.rb
399
+ - specs/cucumber/treetop_parser/empty_feature.feature
400
+ - specs/cucumber/treetop_parser/empty_scenario.feature
401
+ - specs/cucumber/treetop_parser/empty_scenario_outline.feature
402
+ - specs/cucumber/treetop_parser/fit_scenario.feature
403
+ - specs/cucumber/treetop_parser/given_scenario.feature
404
+ - specs/cucumber/treetop_parser/invalid_scenario_outlines.feature
405
+ - specs/cucumber/treetop_parser/multiline_steps.feature
406
+ - specs/cucumber/treetop_parser/multiple_tables.feature
407
+ - specs/cucumber/treetop_parser/scenario_outline.feature
408
+ - specs/cucumber/treetop_parser/spaces.feature
409
+ - specs/cucumber/treetop_parser/test_dos.feature
410
+ - specs/cucumber/treetop_parser/with_comments.feature
411
+ - specs/cucumber/treetop_parser/with_tags.feature
412
+ - specs/cucumber/world/pending_spec.rb
413
+ - specs/spec.opts
414
+ - specs/spec_helper.rb
412
415
  has_rdoc: true
413
416
  homepage: http://cukes.info
414
417
  post_install_message: