cucumber 0.3.104 → 0.4.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/History.txt +50 -3
  2. data/Manifest.txt +20 -2
  3. data/Rakefile +4 -0
  4. data/config/hoe.rb +20 -14
  5. data/examples/i18n/tr/Rakefile +6 -0
  6. data/examples/i18n/tr/features/bo/314/210lme.feature +10 -0
  7. data/examples/i18n/tr/features/step_definitons/hesap_makinesi_ad/304/261mlar/304/261.rb +24 -0
  8. data/examples/i18n/tr/features/toplama.feature +18 -0
  9. data/examples/i18n/tr/lib/hesap_makinesi.rb +15 -0
  10. data/examples/python/features/step_definitions/fib_steps.py +9 -1
  11. data/examples/ruby2python/features/fibonacci.feature +19 -0
  12. data/examples/{python → ruby2python}/features/step_definitions/fib_steps.rb +0 -0
  13. data/examples/ruby2python/features/support/env.rb +21 -0
  14. data/examples/ruby2python/lib/fib.py +7 -0
  15. data/features/bug_475.feature +43 -0
  16. data/features/exception_in_before_block.feature +34 -1
  17. data/features/html_formatter.feature +1 -1
  18. data/features/language_help.feature +68 -0
  19. data/features/rake_task.feature +34 -60
  20. data/features/simplest.feature +11 -0
  21. data/features/step_definitions/simplest_steps.rb +6 -0
  22. data/features/support/env.rb +1 -1
  23. data/features/support/env.rb.simplest +7 -0
  24. data/features/table_diffing.feature +1 -1
  25. data/features/table_mapping.feature +35 -0
  26. data/features/transform.feature +133 -2
  27. data/features/usage_and_stepdefs_formatter.feature +4 -2
  28. data/gem_tasks/contributors.rake +2 -1
  29. data/lib/cucumber/ast/background.rb +17 -5
  30. data/lib/cucumber/ast/outline_table.rb +8 -1
  31. data/lib/cucumber/ast/scenario.rb +2 -1
  32. data/lib/cucumber/ast/step.rb +6 -1
  33. data/lib/cucumber/ast/step_invocation.rb +14 -1
  34. data/lib/cucumber/ast/table.rb +30 -6
  35. data/lib/cucumber/cli/configuration.rb +1 -1
  36. data/lib/cucumber/cli/language_help_formatter.rb +27 -14
  37. data/lib/cucumber/cli/options.rb +2 -1
  38. data/lib/cucumber/cli/profile_loader.rb +12 -4
  39. data/lib/cucumber/core_ext/instance_exec.rb +29 -25
  40. data/lib/cucumber/formatter/junit.rb +50 -45
  41. data/lib/cucumber/formatter/pdf.rb +16 -4
  42. data/lib/cucumber/formatter/usage.rb +2 -14
  43. data/lib/cucumber/language_support/language_methods.rb +23 -3
  44. data/lib/cucumber/languages.yml +14 -0
  45. data/lib/cucumber/parser/natural_language.rb +1 -1
  46. data/lib/cucumber/parser/table.rb +10 -7
  47. data/lib/cucumber/parser/table.tt +1 -1
  48. data/lib/cucumber/platform.rb +1 -0
  49. data/lib/cucumber/py_support/py_dsl.py +10 -8
  50. data/lib/cucumber/py_support/py_language.py +8 -0
  51. data/lib/cucumber/py_support/py_language.rb +24 -11
  52. data/lib/cucumber/rails/action_controller.rb +6 -1
  53. data/lib/cucumber/rails/active_record.rb +5 -4
  54. data/lib/cucumber/rake/task.rb +7 -82
  55. data/lib/cucumber/rb_support/rb_language.rb +0 -4
  56. data/lib/cucumber/rb_support/rb_step_definition.rb +4 -6
  57. data/lib/cucumber/rb_support/rb_transform.rb +9 -7
  58. data/lib/cucumber/step_definition_light.rb +20 -0
  59. data/lib/cucumber/step_match.rb +1 -1
  60. data/lib/cucumber/step_mother.rb +5 -1
  61. data/lib/cucumber/version.rb +3 -3
  62. data/lib/cucumber/webrat/element_locator.rb +2 -0
  63. data/rails_generators/cucumber/cucumber_generator.rb +8 -9
  64. data/rails_generators/cucumber/templates/cucumber +14 -6
  65. data/rails_generators/cucumber/templates/cucumber.rake +9 -1
  66. data/rails_generators/cucumber/templates/cucumber_environment.rb +5 -1
  67. data/rails_generators/cucumber/templates/env.rb +29 -14
  68. data/rails_generators/cucumber/templates/paths.rb +1 -1
  69. data/rails_generators/cucumber/templates/spork_env.rb +39 -17
  70. data/rails_generators/cucumber/templates/version_check.rb +29 -0
  71. data/rails_generators/cucumber/templates/webrat_steps.rb +5 -0
  72. data/spec/cucumber/ast/outline_table_spec.rb +21 -0
  73. data/spec/cucumber/ast/table_spec.rb +18 -0
  74. data/spec/cucumber/formatter/html_spec.rb +33 -69
  75. data/spec/cucumber/formatter/junit_spec.rb +73 -0
  76. data/spec/cucumber/formatter/spec_helper.rb +50 -0
  77. data/spec/cucumber/parser/table_parser_spec.rb +2 -2
  78. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +10 -1
  79. data/spec/cucumber/step_mother_spec.rb +6 -0
  80. metadata +32 -8
  81. data/examples/python/features/support/env.rb +0 -21
data/History.txt CHANGED
@@ -1,7 +1,54 @@
1
+ == 0.4.0 2009-10-08
2
+
3
+ The back to stable release. When we went from 0.3.11 to 0.3.90 we thought we were close to a 0.4.0 release. Then the community
4
+ went nuts and a lot of great contributions came in. Some of those broke backwards compatibility, and we decided it would be
5
+ better to do this while still on 0.3.x.
6
+
7
+ Rails users: you *must* run script/generate cucumber after installing this version.
8
+
9
+ If something breaks for you, please please please read this file carefully. It's most likely something referenced here, and
10
+ that will give you more information so you can solve any problems. If not, just get in touch on IRC or the Google Group.
11
+
12
+ === New Features
13
+ * Total feature parsing time is shown when run with --verbose. Useful for benchmarking with future Ragel parser (Aslak Hellesøy)
14
+ * Tables yielded to step definitions are no longer frozen, so you can edit their data without #dup'ing (Aslak Hellesøy)
15
+ * Transform can now transform tables, using /table:col1,col2,col3/ (#478 Corey Haines)
16
+ * cucumber.yml can also end in .yaml and be located in .config/ or config/ dirs (#447 trans)
17
+ * Turkish support. (Hakan Şenol Ensari)
18
+ * Upgrade Rails generator to set a dependency to Spork 0.7.2. (Aslak Hellesøy)
19
+ * Installation via rubygems will print a message telling people to read this file. (Aslak Hellesøy)
20
+ * Files generated by the Rails cucumber generator have information about the risks of editing. (Aslak Hellesøy)
21
+ * Rotten Cucumber alert on Rails if you upgrade your gem without regenerating with script/generate cucumber. (Aslak Hellesøy)
22
+ * Stop the confusion between "homepage" and "home page" by allowing both (Ryan Bigg & Bodaniel Jeanes)
23
+ * Make script/cucumber file generated by the Rails cucumber generator look for cucumber in vendored gems as well. (Tom ten Thij)
24
+
25
+ === Changed Features
26
+ * Step tables now default empty table cells to empty strings and not nil (#470 Joseph Wilk)
27
+
28
+ === Removed Features
29
+ * The feature_list, feature_pattern, step_list and step_pattern properties are removed from the Rake task. Use profiles instead. (Aslak Hellesøy)
30
+ * The FeatureTask is removed. Use profiles instead.
31
+
32
+ === Bugfixes
33
+ * instance_exec get declared private (#477 Tim Galeckas)
34
+ * Transforms can return nil. (Thomas Marek)
35
+ * Generated rails rake tasks doesn't use the vendored version cucumber binary (#468 Josh Nichols)
36
+ * Incorrect diagnostics in case when Before raises in presence of Background (#465 Fedor Kocherga)
37
+ * Error on pystring in scenario outline with pretty formatter (#475 Aslak Hellesøy)
38
+ * Adding After('@allow-rescue') to set allow_rescue back to its former value. (Alf Mikula)
39
+ * Feature files are now sorted before they are executed, because different operating systems may list files differently. (Aslak Hellesøy)
40
+ * Fixed image loading for Windows in PDF formatter. Allow use of both png and jpg. (#461 Declan Whelan)
41
+ * Before('~@no-txn') is run on all scenarios without @no-txn causing Cucumber::Rails::World.use_transactional_fixtures to always be true. (#457 Aslak Hellesøy)
42
+ * JUnit formatter not handling scenario outline tables (#472 Matt Wynne)
43
+ * Language help broken (#467 Matt Wynne)
44
+ * Language help formatter aligns output better on Ruby 1.8.6 (Aslak Hellesøy)
45
+ * Better backtraces for Ruby 1.8.7. (Jakob Skov-Pedersen)
46
+ * String step definitions ( Given 'I have $number cucumbers' ) are escaped before being turned into regular expressions. (David Waite)
47
+
1
48
  == 0.3.104 2009-09-27
2
49
 
3
50
  This release has some minor changes to the command line and formatters. The biggest change is internally, paving
4
- the way for more programming language support in Cuke4Duke, which now supports step definitions written in Java, Scala,
51
+ the way for more programming language support in Cuke4Duke, which now supports step definitions written in Java, Scala,
5
52
  Groovy, Clojure and Javascript!
6
53
 
7
54
  === New Features
@@ -25,7 +72,7 @@ Groovy, Clojure and Javascript!
25
72
 
26
73
  == 0.3.103 2009-09-24
27
74
 
28
- This release gives you back some of the control over the Rails environment that was accidentally taken away from you in the
75
+ This release gives you back some of the control over the Rails environment that was accidentally taken away from you in the
29
76
  previous release.
30
77
 
31
78
  Using this release on a Rails project requires a rerun of script/generate cucumber.
@@ -489,7 +536,7 @@ versions). In lib/tasks/cucumber.rake:
489
536
  (If you run script/generate cucumber this will be done for you).
490
537
  Alternatively you can omit forking and run features like this:
491
538
 
492
- RAILS_ENV=test rake features
539
+ RAILS_ENV=test rake cucumber
493
540
 
494
541
  However, setting the RAILS_ENV is easy to forget, so I don't recommend relying on this.
495
542
 
data/Manifest.txt CHANGED
@@ -147,6 +147,11 @@ examples/i18n/sk/features/addition.feature
147
147
  examples/i18n/sk/features/division.feature
148
148
  examples/i18n/sk/features/step_definitons/calculator_steps.rb
149
149
  examples/i18n/sk/lib/calculator.rb
150
+ examples/i18n/tr/Rakefile
151
+ examples/i18n/tr/features/bölme.feature
152
+ examples/i18n/tr/features/step_definitons/hesap_makinesi_adımları.rb
153
+ examples/i18n/tr/features/toplama.feature
154
+ examples/i18n/tr/lib/hesap_makinesi.rb
150
155
  examples/i18n/uz/Rakefile
151
156
  examples/i18n/uz/features/addition.feature
152
157
  examples/i18n/uz/features/consecutive_calculations.feature
@@ -177,8 +182,6 @@ examples/junit/features/step_definitions/steps.rb
177
182
  examples/pure_java/README.textile
178
183
  examples/python/features/fibonacci.feature
179
184
  examples/python/features/step_definitions/fib_steps.py
180
- examples/python/features/step_definitions/fib_steps.rb
181
- examples/python/features/support/env.rb
182
185
  examples/python/lib/fib.py
183
186
  examples/ramaze/README.textile
184
187
  examples/ramaze/Rakefile
@@ -188,6 +191,10 @@ examples/ramaze/features/step_definitions/add_steps.rb
188
191
  examples/ramaze/features/support/env.rb
189
192
  examples/ramaze/layout/default.html.erb
190
193
  examples/ramaze/view/index.html.erb
194
+ examples/ruby2python/features/fibonacci.feature
195
+ examples/ruby2python/features/step_definitions/fib_steps.rb
196
+ examples/ruby2python/features/support/env.rb
197
+ examples/ruby2python/lib/fib.py
191
198
  examples/selenium/Rakefile
192
199
  examples/selenium/features/search.feature
193
200
  examples/selenium/features/step_definitons/search_steps.rb
@@ -272,6 +279,7 @@ examples/watir/features/step_definitons/search_steps.rb
272
279
  examples/watir/features/support/env.rb
273
280
  features/background.feature
274
281
  features/bug_371.feature
282
+ features/bug_475.feature
275
283
  features/cucumber_cli.feature
276
284
  features/cucumber_cli_diff_disabled.feature
277
285
  features/cucumber_cli_outlines.feature
@@ -287,17 +295,22 @@ features/html_formatter.feature
287
295
  features/html_formatter/a.html
288
296
  features/junit_formatter.feature
289
297
  features/language_from_header.feature
298
+ features/language_help.feature
290
299
  features/multiline_names.feature
291
300
  features/negative_tagged_hooks.feature
292
301
  features/post_configuration_hook.feature
293
302
  features/profiles.feature
294
303
  features/rake_task.feature
295
304
  features/report_called_undefined_steps.feature
305
+ features/simplest.feature
296
306
  features/snippet.feature
297
307
  features/step_definitions/cucumber_steps.rb
298
308
  features/step_definitions/extra_steps.rb
309
+ features/step_definitions/simplest_steps.rb
299
310
  features/support/env.rb
311
+ features/support/env.rb.simplest
300
312
  features/table_diffing.feature
313
+ features/table_mapping.feature
301
314
  features/transform.feature
302
315
  features/unicode_table.feature
303
316
  features/usage_and_stepdefs_formatter.feature
@@ -400,6 +413,7 @@ lib/cucumber/rb_support/rb_world.rb
400
413
  lib/cucumber/rb_support/regexp_argument_matcher.rb
401
414
  lib/cucumber/rspec_neuter.rb
402
415
  lib/cucumber/step_argument.rb
416
+ lib/cucumber/step_definition_light.rb
403
417
  lib/cucumber/step_match.rb
404
418
  lib/cucumber/step_mother.rb
405
419
  lib/cucumber/version.rb
@@ -413,6 +427,7 @@ rails_generators/cucumber/templates/cucumber_environment.rb
413
427
  rails_generators/cucumber/templates/env.rb
414
428
  rails_generators/cucumber/templates/paths.rb
415
429
  rails_generators/cucumber/templates/spork_env.rb
430
+ rails_generators/cucumber/templates/version_check.rb
416
431
  rails_generators/cucumber/templates/webrat_steps.rb
417
432
  rails_generators/feature/USAGE
418
433
  rails_generators/feature/feature_generator.rb
@@ -422,6 +437,7 @@ spec/cucumber/ast/background_spec.rb
422
437
  spec/cucumber/ast/feature_element_spec.rb
423
438
  spec/cucumber/ast/feature_factory.rb
424
439
  spec/cucumber/ast/feature_spec.rb
440
+ spec/cucumber/ast/outline_table_spec.rb
425
441
  spec/cucumber/ast/py_string_spec.rb
426
442
  spec/cucumber/ast/scenario_outline_spec.rb
427
443
  spec/cucumber/ast/scenario_spec.rb
@@ -440,7 +456,9 @@ spec/cucumber/formatter/ansicolor_spec.rb
440
456
  spec/cucumber/formatter/color_io_spec.rb
441
457
  spec/cucumber/formatter/duration_spec.rb
442
458
  spec/cucumber/formatter/html_spec.rb
459
+ spec/cucumber/formatter/junit_spec.rb
443
460
  spec/cucumber/formatter/progress_spec.rb
461
+ spec/cucumber/formatter/spec_helper.rb
444
462
  spec/cucumber/parser/feature_parser_spec.rb
445
463
  spec/cucumber/parser/table_parser_spec.rb
446
464
  spec/cucumber/rb_support/rb_step_definition_spec.rb
data/Rakefile CHANGED
@@ -6,4 +6,8 @@ Dir['gem_tasks/**/*.rake'].each { |rake| load rake }
6
6
 
7
7
  # Hoe gives us :default => :test, but we don't have Test::Unit tests.
8
8
  Rake::Task[:default].clear_prerequisites rescue nil # For some super weird reason this fails for some...
9
+ Rake.application.options.trace = true
9
10
  task :default => [:spec, :cucumber]
11
+
12
+ require 'rake/clean'
13
+ CLEAN.include %w(**/*.{log,pyc})
data/config/hoe.rb CHANGED
@@ -48,19 +48,19 @@ end
48
48
 
49
49
  # Generate all the Rake tasks
50
50
  # Run 'rake -T' to see list of generated tasks (from gem root directory)
51
- $hoe = Hoe.spec(GEM_NAME) do |p|
52
- p.version = VERS
53
- p.developer(AUTHOR, EMAIL)
54
- p.description = DESCRIPTION
55
- p.summary = DESCRIPTION
56
- p.url = HOMEPATH
57
- p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
58
- p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store', '**/*.class', '**/*.jar', '**/tmp'] #An array of file patterns to delete on clean.
51
+ $hoe = Hoe.spec(GEM_NAME) do
52
+ @version = VERS
53
+ developer(AUTHOR, EMAIL)
54
+ @description = DESCRIPTION
55
+ @summary = DESCRIPTION
56
+ @url = HOMEPATH
57
+ @rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
58
+ @clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store', '**/*.class', '**/*.jar', '**/tmp'] #An array of file patterns to delete on clean.
59
59
 
60
60
  # == Optional
61
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
62
- #p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
63
- p.extra_deps = [
61
+ @changes = paragraphs_of("History.txt", 0..1).join("\n\n")
62
+ # @extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
63
+ @extra_deps = [
64
64
  ['term-ansicolor', '>= 1.0.3'],
65
65
  ['treetop', '>= 1.4.2'],
66
66
  ['polyglot', '>= 0.2.9'], # Don't really want polyglot, but it keeps breaking so we'll make people use something that works ok'ish
@@ -68,11 +68,17 @@ $hoe = Hoe.spec(GEM_NAME) do |p|
68
68
  ['builder', '>= 2.1.2']
69
69
  ]
70
70
 
71
- #p.spec_extras = {} # A hash of extra values to set in the gemspec.
72
-
71
+ #@spec_extras = {} # A hash of extra values to set in the gemspec.
72
+ @post_install_message = <<-POST_INSTALL_MESSAGE
73
+ *******************************************************************************
74
+ Thank you for installing cucumber-#{Cucumber::VERSION::STRING}
75
+ Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading
76
+ for important information about this release.
77
+ *******************************************************************************
78
+ POST_INSTALL_MESSAGE
73
79
  end
74
80
 
75
81
  CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
76
82
  PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
77
83
  $hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
78
- $hoe.rsync_args = '-av --delete --ignore-errors'
84
+ $hoe.rsync_args = '-av --delete --ignore-errors'
@@ -0,0 +1,6 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new do |t|
5
+ t.cucumber_opts = %w{--format pretty}
6
+ end
@@ -0,0 +1,10 @@
1
+ # language: tr
2
+ Özellik: Bölme
3
+ Gülünç hatalardan sakınmak için
4
+ Bir kasiyer sayıları bölebilmeli
5
+
6
+ Senaryo: Doğal sayılar
7
+ Diyelim ki hesap makinesine 3 girdim
8
+ Ve hesap makinesine 2 girdim
9
+ Eğer ki böl tuşuna basarsam
10
+ O zaman ekrandaki sonuç 1.5 olmalı
@@ -0,0 +1,24 @@
1
+ # encoding: utf-8
2
+ require 'spec/expectations'
3
+ $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
+ require 'cucumber/formatter/unicode'
5
+ require 'hesap_makinesi'
6
+
7
+ Before do
8
+ @calc = HesapMakinesi.new
9
+ end
10
+
11
+ After do
12
+ end
13
+
14
+ Given /hesap makinesine (\d+) girdim/ do |n|
15
+ @calc.push n.to_i
16
+ end
17
+
18
+ When /(\w+) tuşuna basarsam/ do |op|
19
+ @result = @calc.send op
20
+ end
21
+
22
+ Then /ekrandaki sonuç (.*) olmalı/ do |result|
23
+ @result.should == result.to_f
24
+ end
@@ -0,0 +1,18 @@
1
+ # language: tr
2
+ Özellik: Toplama
3
+ Gülünç hatalardan sakınmak için
4
+ Matematikten anlamayan bir ahmak olarak
5
+ Hesap makinasının bana iki sayının toplamını bulmasını istiyorum
6
+
7
+ Senaryo taslağı: İki sayıyı topla
8
+ Diyelim ki hesap makinesine <girdi_1> girdim
9
+ Ve hesap makinesine <girdi_2> girdim
10
+ Eğer ki <düğme> tuşuna basarsam
11
+ O zaman ekrandaki sonuç <çıktı> olmalı
12
+
13
+ Örnekler:
14
+ | girdi_1 | girdi_2 | düğme | çıktı |
15
+ | 20 | 30 | topla | 50 |
16
+ | 2 | 5 | topla | 7 |
17
+ | 0 | 40 | topla | 40 |
18
+
@@ -0,0 +1,15 @@
1
+ # encoding: utf-8
2
+ class HesapMakinesi
3
+ def push(n)
4
+ @args ||= []
5
+ @args << n
6
+ end
7
+
8
+ def topla
9
+ @args.inject(0){|n,sum| sum+=n}
10
+ end
11
+
12
+ def böl
13
+ @args[0].to_f / @args[1].to_f
14
+ end
15
+ end
@@ -1,3 +1,11 @@
1
1
  from py_dsl import *
2
2
 
3
- Given("Hello from python")
3
+ @Given("^I ask python to calculate fibonacci up to (\d+)$")
4
+ def calc_fib_upto(n):
5
+ print("CALCULATING FIB")
6
+ #self.fib_result = fib.fib(n.to_i)
7
+
8
+ @Given("^it should give me (\[.*\])$")
9
+ def fib_should_be(n):
10
+ print("COMPARING FIB")
11
+ #self.fib_result = fib.fib(n.to_i)
@@ -0,0 +1,19 @@
1
+ Feature: Fibonacci
2
+ In order to calculate super fast fibonacci series
3
+ As a pythonista
4
+ I want to use Python for that
5
+
6
+ Scenario Outline: Series
7
+ When I ask python to calculate fibonacci up to <n>
8
+ Then it should give me <series>
9
+
10
+ Examples:
11
+ | n | series |
12
+ | 1 | [] |
13
+ | 2 | [1, 1] |
14
+ | 3 | [1, 1, 2] |
15
+ | 4 | [1, 1, 2, 3] |
16
+ | 6 | [1, 1, 2, 3, 5] |
17
+ | 9 | [1, 1, 2, 3, 5, 8] |
18
+ | 100 | [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] |
19
+
@@ -0,0 +1,21 @@
1
+ require 'rubypython'
2
+
3
+ ENV['PYTHONPATH'] = File.expand_path(File.dirname(__FILE__) + '/../../lib')
4
+
5
+ Before do
6
+ RubyPython.start
7
+ @fib = RubyPython.import('fib')
8
+ end
9
+
10
+ After do
11
+ RubyPython.stop
12
+ end
13
+
14
+ # RubyPython seems to expect this to exist (?)
15
+ class String
16
+ def end_with?(str)
17
+ str = str.to_str
18
+ tail = self[-str.length, str.length]
19
+ tail == str
20
+ end
21
+ end
@@ -0,0 +1,7 @@
1
+ def fib(n):
2
+ result = []
3
+ a, b = 0, 1
4
+ while b < n:
5
+ result.append(b)
6
+ a, b = b, a+b
7
+ return result
@@ -0,0 +1,43 @@
1
+ Feature: https://rspec.lighthouseapp.com/projects/16211/tickets/475
2
+ Scenario: error on pystring in scenario outline with pretty formatter
3
+ Given a standard Cucumber project directory structure
4
+ And a file named "features/f.feature" with:
5
+ """
6
+ Feature: F
7
+ Scenario Outline: S
8
+ Given a multiline string:
9
+ \"\"\"
10
+ hello <who>
11
+ \"\"\"
12
+ Examples:
13
+ | who |
14
+ | aslak |
15
+ | david |
16
+ """
17
+ And a file named "features/step_definitions/steps.rb" with:
18
+ """
19
+ Given /a multiline string:/ do |s|
20
+ s.should =~ /hello (\w+)/
21
+ end
22
+ """
23
+ When I run cucumber features/f.feature
24
+ Then STDERR should be empty
25
+ And it should pass with
26
+ """
27
+ Feature: F
28
+
29
+ Scenario Outline: S # features/f.feature:2
30
+ Given a multiline string: # features/step_definitions/steps.rb:1
31
+ \"\"\"
32
+ hello <who>
33
+ \"\"\"
34
+
35
+ Examples:
36
+ | who |
37
+ | aslak |
38
+ | david |
39
+
40
+ 2 scenarios (2 passed)
41
+ 2 steps (2 passed)
42
+
43
+ """
@@ -44,4 +44,37 @@ Feature: Exception in Before Block
44
44
  1 scenario (1 failed)
45
45
  1 step (1 skipped)
46
46
 
47
- """
47
+ """
48
+
49
+ @mri186
50
+ Scenario: Handle Exception in Before hook for Scenario with Background
51
+ Given a file named "features/naughty_step_in_before.feature" with:
52
+ """
53
+ Feature: Sample
54
+
55
+ Background:
56
+ Given this step works
57
+
58
+ Scenario: Run a good step
59
+ Given this step works
60
+ """
61
+ When I run cucumber features
62
+ Then it should fail with
63
+ """
64
+ Feature: Sample
65
+
66
+ Background: # features/naughty_step_in_before.feature:3
67
+ I cannot even start this scenario (SomeSetupException)
68
+ ./features/support/env.rb:4:in `Before'
69
+ Given this step works # features/step_definitions/steps.rb:1
70
+
71
+ Scenario: Run a good step # features/naughty_step_in_before.feature:6
72
+ Given this step works # features/step_definitions/steps.rb:1
73
+
74
+ Failing Scenarios:
75
+ cucumber features/naughty_step_in_before.feature:6 # Scenario: Run a good step
76
+
77
+ 1 scenario (1 failed)
78
+ 2 steps (1 skipped, 1 passed)
79
+
80
+ """