cucumber 2.0.0.rc.4 → 2.0.0.rc.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +74 -52
  3. data/examples/i18n/ht/Rakefile +6 -0
  4. data/examples/i18n/ht/features/adisyon.feature +17 -0
  5. data/examples/i18n/ht/features/divizyon.feature +10 -0
  6. data/examples/i18n/ht/features/step_definitions/kalkilatris_steps.rb +25 -0
  7. data/examples/i18n/ht/lib/kalkilatris.rb +14 -0
  8. data/features/docs/cli/dry_run.feature +43 -0
  9. data/features/docs/cli/strict_mode.feature +24 -1
  10. data/features/docs/defining_steps/nested_steps.feature +49 -0
  11. data/features/docs/exception_in_after_step_hook.feature +1 -1
  12. data/features/docs/exception_in_around_hook.feature +80 -0
  13. data/features/docs/formatters/json_formatter.feature +65 -1
  14. data/features/docs/formatters/junit_formatter.feature +40 -0
  15. data/features/docs/{wire_protocol_erb.feature → wire_protocol/erb_configuration.feature} +2 -2
  16. data/features/docs/wire_protocol/handle_unexpected_response.feature +30 -0
  17. data/features/docs/wire_protocol/invoke_message.feature +216 -0
  18. data/features/docs/wire_protocol/readme.md +26 -0
  19. data/features/docs/wire_protocol/snippets_message.feature +51 -0
  20. data/features/docs/wire_protocol/step_matches_message.feature +81 -0
  21. data/features/docs/{wire_protocol_table_diffing.feature → wire_protocol/table_diffing.feature} +1 -0
  22. data/features/docs/{wire_protocol_tags.feature → wire_protocol/tags.feature} +1 -0
  23. data/features/docs/{wire_protocol_timeouts.feature → wire_protocol/timeouts.feature} +1 -0
  24. data/features/docs/work_in_progress.feature +1 -1
  25. data/features/docs/writing_support_code/around_hooks.feature +31 -0
  26. data/features/docs/writing_support_code/before_hook.feature +7 -3
  27. data/features/docs/writing_support_code/tagged_hooks.feature +44 -6
  28. data/features/lib/step_definitions/wire_steps.rb +18 -1
  29. data/features/lib/support/fake_wire_server.rb +10 -7
  30. data/lib/cucumber.rb +1 -3
  31. data/lib/cucumber/cli/options.rb +7 -0
  32. data/lib/cucumber/encoding.rb +5 -0
  33. data/lib/cucumber/errors.rb +8 -0
  34. data/lib/cucumber/filters/prepare_world.rb +13 -5
  35. data/lib/cucumber/formatter/console.rb +1 -1
  36. data/lib/cucumber/formatter/gherkin_formatter_adapter.rb +9 -6
  37. data/lib/cucumber/formatter/junit.rb +95 -0
  38. data/lib/cucumber/formatter/legacy_api/adapter.rb +39 -3
  39. data/lib/cucumber/platform.rb +1 -1
  40. data/lib/cucumber/project_initializer.rb +43 -0
  41. data/lib/cucumber/rb_support/rb_step_definition.rb +11 -2
  42. data/lib/cucumber/rb_support/rb_world.rb +2 -2
  43. data/lib/cucumber/rb_support/snippet.rb +1 -1
  44. data/lib/cucumber/rspec/doubles.rb +1 -1
  45. data/lib/cucumber/running_test_case.rb +115 -0
  46. data/lib/cucumber/runtime.rb +5 -1
  47. data/lib/cucumber/runtime/for_programming_languages.rb +2 -2
  48. data/lib/cucumber/runtime/support_code.rb +18 -8
  49. data/spec/cucumber/formatter/junit_spec.rb +212 -156
  50. data/spec/cucumber/formatter/legacy_api/adapter_spec.rb +89 -1
  51. data/spec/cucumber/formatter/pretty_spec.rb +13 -0
  52. data/spec/cucumber/project_initializer_spec.rb +87 -0
  53. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +21 -3
  54. data/spec/cucumber/rb_support/snippet_spec.rb +6 -6
  55. data/spec/cucumber/running_test_case_spec.rb +83 -0
  56. data/spec/spec_helper.rb +1 -4
  57. metadata +35 -18
  58. data/bin/cuke +0 -60
  59. data/features/docs/report_called_undefined_steps.feature +0 -57
  60. data/features/docs/wire_protocol.feature +0 -337
  61. data/lib/cucumber/ast/facade.rb +0 -117
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3110fb4364ae31f8a5da94139d812effa7acd9bf
4
- data.tar.gz: 0fb0d7f3a973bb50ee76195c9380730e03cb3382
3
+ metadata.gz: 89ecd30f7af5ab85e66c9aaa0ea1b02a333ed2b7
4
+ data.tar.gz: 54bef93b9f1d18aeccbfa7a2fceaba2272fa2690
5
5
  SHA512:
6
- metadata.gz: 661376d7cf4efabbdc1e08183be15c758ce97083821267fbfd164c3a5e5a490ccd74c7a964e62ef1770d0b74d69ae1ca9375d1bcab2b3df33b0d92eb4cc73949
7
- data.tar.gz: fd834e7e4c21bbedf1f5b1981ecdc6bdd4775a5c6e5facbbe122c6c47961370738e69068b58c015346adb311c2b920d773b096c34a5cfb643a16d1b68fbccf6c
6
+ metadata.gz: f295d0cf32e842627647ed13d4bafffbfa9e0f19cc8fa86fbe3da2ceea12700609e33eeabc53b457cc875e53f5b47973acf118139a29a49a53b490334afd3bd1
7
+ data.tar.gz: 50727adb43830520a8413d8fd01fd343055e1fdbde46f1da042991c6a53aba25aea931bffdfcb6457992165f12ce8b53007b17b437c124067a2e4af73ce15492
data/History.md CHANGED
@@ -1,93 +1,110 @@
1
- ## [In Git](https://github.com/cucumber/cucumber/compare/v2.0.0.rc.3...master)
1
+ ## [In Git](https://github.com/cucumber/cucumber/compare/v2.0.0.rc.4...master)
2
+
3
+ ### New Features
4
+
5
+ * Add `--init` command ([699](https://github.com/cucumber/cucumber/pull/699) @LGordon2)
6
+
7
+ ## Bugfixes
8
+
9
+ * Let the JUnitFormatter handle Scenario Outlines with the --expand option ([124](https://github.com/cucumber/cucumber/issues/124), [808](https://github.com/cucumber/cucumber/pull/808) @brasmusson, @richarda)
10
+ * Suggested regexes result in ambigous matches ([663](https://github.com/cucumber/cucumber/pull/663) @rwz)
11
+ * Pass when using both the --dry-run and the --strict options, unless there are undefined steps ([810](https://github.com/cucumber/cucumber/issues/810) @brasmusson)
12
+ * Handle step output correctly for Scenario Outlines with the --expand option ([806](https://github.com/cucumber/cucumber/issues/806) @brasmusson)
13
+ * Fix GBK and UTF-8 (Encoding::CompatibilityError) ([693](https://github.com/cucumber/cucumber/issues/693) @mattwynne)
14
+ * Make the scenario object available in hooks compatible with v1.3.x ([814](https://github.com/cucumber/cucumber/pull/814) @brasmusson)
15
+ * JUnit expand option ([808](https://github.com/cucumber/cucumber/pull/808) @richarda @brasmusson)
16
+ * Around hooks not executing in correct world context ([807](https://github.com/cucumber/cucumber/pull/807) @tooky)
17
+
18
+ ## [v2.0.0.rc.4](https://github.com/cucumber/cucumber/compare/v2.0.0.rc.3...2.0.0.rc.4)
2
19
 
3
20
  ### Features
4
21
 
5
- * [Add custom filters from Ruby configuration code](https://github.com/cucumber/cucumber/blob/master/features/docs/extending_cucumber/custom_filter.feature) (@mattwynne)
22
+ * [Add custom filters from Ruby configuration code](https://github.com/cucumber/cucumber/blob/master/features/docs/extending_cucumber/custom_filter.feature) (@mattwynne)
6
23
 
7
24
  ### Bugfixes
8
25
 
9
- * Fix missing `require Forwardable` (@tooky)
10
- * Fix snippet suggestions ([765](https://github.com/cucumber/cucumber/pull/765) @richarda), also with i18n languages (@brasmusson)
11
- * Fix transformation of regex with lookahead/lookbehind ([796](https://github.com/cucumber/cucumber/pull/796) @bolshakov)
12
- * Sort scenarios by location ([789](https://github.com/cucumber/cucumber/issues/789) @mattwynne)
13
- * Remove keyword from name property of test case object yielded to hooks ([768](https://github.com/cucumber/cucumber/issues/768) @richarda, @akostadinov)
26
+ * Fix missing `require Forwardable` (@tooky)
27
+ * Fix snippet suggestions ([765](https://github.com/cucumber/cucumber/pull/765) @richarda), also with i18n languages (@brasmusson)
28
+ * Fix transformation of regex with lookahead/lookbehind ([796](https://github.com/cucumber/cucumber/pull/796) @bolshakov)
29
+ * Sort scenarios by location ([789](https://github.com/cucumber/cucumber/issues/789) @mattwynne)
30
+ * Remove keyword from name property of test case object yielded to hooks ([768](https://github.com/cucumber/cucumber/issues/768) @richarda, @akostadinov)
14
31
 
15
32
  ## [v2.0.0.rc.3](https://github.com/cucumber/cucumber/compare/v2.0.0.rc.2...v2.0.0.rc.3)
16
33
 
17
34
  ### Bugfixes
18
35
 
19
- * MultilineArgument::DataTable#diff will correctly compare to an Array (@tooky)
36
+ * MultilineArgument::DataTable#diff will correctly compare to an Array (@tooky)
20
37
 
21
38
  ## [v2.0.0.rc.2](https://github.com/cucumber/cucumber/compare/v2.0.0.rc.1...v2.0.0.rc.2)
22
39
 
23
40
  ### Bugfixes
24
41
 
25
- * World#table no longer creates invalid table objects when using an Array (@tooky, @mattwynne)
42
+ * World#table no longer creates invalid table objects when using an Array (@tooky, @mattwynne)
26
43
 
27
44
  ## [v2.0.0.rc.1](https://github.com/cucumber/cucumber/compare/v2.0.0.beta.5...v2.0.0.rc.1)
28
45
 
29
46
  ### Removed Features
30
47
 
31
- * Removed support for IronRuby (@tooky @mattwynne)
48
+ * Removed support for IronRuby (@tooky @mattwynne)
32
49
 
33
50
  ### New Features
34
51
 
35
- * Let the HTML formatter store the relative path to files in the report ([697](https://github.com/cucumber/cucumber/pull/697) @idstein, @brasmusson)
36
- * Allow cucumber.yml to parse % erb code lines ([755](https://github.com/cucumber/cucumber/pull/755) @snowe2010)
37
- * Give each step definition a unique copy of argument objects ([760](https://github.com/cucumber/cucumber/pull/760) @tooky)
52
+ * Let the HTML formatter store the relative path to files in the report ([697](https://github.com/cucumber/cucumber/pull/697) @idstein, @brasmusson)
53
+ * Allow cucumber.yml to parse % erb code lines ([755](https://github.com/cucumber/cucumber/pull/755) @snowe2010)
54
+ * Give each step definition a unique copy of argument objects ([760](https://github.com/cucumber/cucumber/pull/760) @tooky)
38
55
 
39
56
  ### Bugfixes
40
57
 
41
- * Add old Scenario#skip_invoke! method back (@mattwynne)
42
- * No links to lines in backtrace under TextMate ([548](https://github.com/cucumber/cucumber/pull/548) @bilus)
43
- * Using file:line CLI to select scenarios was running same scenario multiple times ([786](https://github.com/cucumber/cucumber/pull/786) @jdks)
44
- * Allow spaces in filenames for rerun formatter ([793](https://github.com/cucumber/cucumber/pull/793) @callahat)
58
+ * Add old Scenario#skip_invoke! method back (@mattwynne)
59
+ * No links to lines in backtrace under TextMate ([548](https://github.com/cucumber/cucumber/pull/548) @bilus)
60
+ * Using file:line CLI to select scenarios was running same scenario multiple times ([786](https://github.com/cucumber/cucumber/pull/786) @jdks)
61
+ * Allow spaces in filenames for rerun formatter ([793](https://github.com/cucumber/cucumber/pull/793) @callahat)
45
62
 
46
63
  ## [v2.0.0.beta.5](https://github.com/cucumber/cucumber/compare/v2.0.0.beta.4...v2.0.0.beta.5)
47
64
 
48
- * Depend on the correct version of core (@tooky)
65
+ * Depend on the correct version of core (@tooky)
49
66
 
50
67
  ## [v2.0.0.beta.4](https://github.com/cucumber/cucumber/compare/v2.0.0.beta.3...v2.0.0.beta.4)
51
68
  ### New Features
52
69
 
53
- * Support both new and legacy formatter APIs simultaneously (@mattwynne and @tooky)
70
+ * Support both new and legacy formatter APIs simultaneously (@mattwynne and @tooky)
54
71
 
55
72
  ### Bugfixes
56
73
 
57
- * Localize the Scenario keyword with the --expand option ([766](https://github.com/cucumber/cucumber/pull/766) @brasmusson)
58
- * Handle hook output appropriately in the HTML formatter ([746](https://github.com/cucumber/cucumber/pull/746), [731](https://github.com/cucumber/cucumber/issues/731), [298](https://github.com/cucumber/cucumber/pull/298) @brasmusson)
59
- * Handle hook output appropriately in the Pretty formatter ([738](https://github.com/cucumber/cucumber/pull/738) @brasmusson)
74
+ * Localize the Scenario keyword with the --expand option ([766](https://github.com/cucumber/cucumber/pull/766) @brasmusson)
75
+ * Handle hook output appropriately in the HTML formatter ([746](https://github.com/cucumber/cucumber/pull/746), [731](https://github.com/cucumber/cucumber/issues/731), [298](https://github.com/cucumber/cucumber/pull/298) @brasmusson)
76
+ * Handle hook output appropriately in the Pretty formatter ([738](https://github.com/cucumber/cucumber/pull/738) @brasmusson)
60
77
 
61
78
  ### Internal changes
62
79
 
63
- * Re-write rerun formatter against new formatter API
80
+ * Re-write rerun formatter against new formatter API
64
81
 
65
82
  ## [v2.0.0.beta.3](https://github.com/cucumber/cucumber/compare/v2.0.0.beta.2...v2.0.0.beta.3)
66
83
 
67
84
  ### Removed Features
68
85
 
69
- * The `--dotcucumber` option is no longer supported and `stepdefs.json` is no longer written. (Aslak Hellesøy)
86
+ * The `--dotcucumber` option is no longer supported and `stepdefs.json` is no longer written. (Aslak Hellesøy)
70
87
 
71
88
  ### New Features
72
89
 
73
- * Include both outline step and expanded step in error backtrace ([730](https://github.com/cucumber/cucumber/pull/730) @brasmusson)
74
- * Add TestCase#outline? for conditionals in Before / After hooks ([728](https://github.com/cucumber/cucumber/pull/728) [Erran Carey](https://github.com/erran))
75
- * Support embedding images directly in HTML and JSON reports ([696](https://github.com/cucumber/cucumber/pull/696),[695](https://github.com/cucumber/cucumber/pull/695/files) @brasmusson)
90
+ * Include both outline step and expanded step in error backtrace ([730](https://github.com/cucumber/cucumber/pull/730) @brasmusson)
91
+ * Add TestCase#outline? for conditionals in Before / After hooks ([728](https://github.com/cucumber/cucumber/pull/728) [Erran Carey](https://github.com/erran))
92
+ * Support embedding images directly in HTML and JSON reports ([696](https://github.com/cucumber/cucumber/pull/696),[695](https://github.com/cucumber/cucumber/pull/695/files) @brasmusson)
76
93
 
77
94
  ### Bugfixes
78
95
 
79
- * Pass hook output to the formatters appropriately ([732](https://github.com/cucumber/cucumber/pull/732) @brasmusson)
80
- * Added tests for, and re-added behaviour to support Scenario#failed? in hooks (Matt Wynne)
81
- * Rescuing ArgumentError in HTML formatter so Cucumber won't stop tests due bad encoding ([690](https://github.com/cucumber/cucumber/pull/690) @awls99)
82
- * Add back support for the DataTable API ([729](https://github.com/cucumber/cucumber/pull/729) @mattwynne and @tooky)
83
- * Fix Windows support loading files properly ([739](https://github.com/cucumber/cucumber/issues/739) @os97673)
96
+ * Pass hook output to the formatters appropriately ([732](https://github.com/cucumber/cucumber/pull/732) @brasmusson)
97
+ * Added tests for, and re-added behaviour to support Scenario#failed? in hooks (Matt Wynne)
98
+ * Rescuing ArgumentError in HTML formatter so Cucumber won't stop tests due bad encoding ([690](https://github.com/cucumber/cucumber/pull/690) @awls99)
99
+ * Add back support for the DataTable API ([729](https://github.com/cucumber/cucumber/pull/729) @mattwynne and @tooky)
100
+ * Fix Windows support loading files properly ([739](https://github.com/cucumber/cucumber/issues/739) @os97673)
84
101
 
85
102
  ## [v2.0.0.beta.2](https://github.com/cucumber/cucumber/compare/v2.0.0.beta.1...v2.0.0.beta.2)
86
103
 
87
104
  ### Bugfixes
88
105
 
89
- * Better reporting of exceptions in Before / After hooks ([723](https://github.com/cucumber/cucumber/pull/723) @mattwynne)
90
- * Add `#source_tag_names` method to `TestCase` object passed to hooks (@mattwynne)
106
+ * Better reporting of exceptions in Before / After hooks ([723](https://github.com/cucumber/cucumber/pull/723) @mattwynne)
107
+ * Add `#source_tag_names` method to `TestCase` object passed to hooks (@mattwynne)
91
108
 
92
109
  ## [v2.0.0.beta.1 ](https://github.com/cucumber/cucumber/compare/v1.3.8...v2.0.0.beta.1)
93
110
 
@@ -149,7 +166,7 @@ all.
149
166
  ## [v1.3.12](https://github.com/cucumber/cucumber/compare/v1.3.11...v1.3.12)
150
167
 
151
168
  * Use MultiTest to handle assertions library selection (@tooky)
152
- * Adds full support for rails 4.1 / Minitest
169
+ * Adds full support for rails 4.1 / Minitest
153
170
 
154
171
  ## [v1.3.11](https://github.com/cucumber/cucumber/compare/v1.3.10...v1.3.11)
155
172
 
@@ -634,7 +651,7 @@ Bugfix release which most importantly fixes an issue with the gem's gemspec.
634
651
  * JSON formatters (json and json_pretty). (Jari Bakken)
635
652
 
636
653
  ### Removed features
637
- * The --no-diff option is removed. If you're using RSpec you will *always* get diffs. (Aslak Hellesøy)
654
+ * The --no-diff option is removed. If you're using RSpec you will*always* get diffs. (Aslak Hellesøy)
638
655
 
639
656
  ### Changed Features
640
657
  * Upgraded to be compatible with rspec 2.0.0.beta.10 (Aslak Hellesøy)
@@ -839,7 +856,7 @@ Please see History.txt in cucumber-rails for details about what's new on the Rai
839
856
  * "Given" in Dutch is now aliased to "Gegeven" or "Stel". (Iain Hecker)
840
857
  * New --i18n option to list keywords in various languages. (Aslak Hellesøy)
841
858
  * Added a Tcl example using Sam Stephenson's ruby-tcl (Aslak Hellesøy)
842
- * Added * as a synonym for Given/When/Then/And/But (for all i18n languages). (#462 Aslak Hellesøy)
859
+ * Added* as a synonym for Given/When/Then/And/But (for all i18n languages). (#462 Aslak Hellesøy)
843
860
  * The HTML formatter produces a much nicer report, with TextMate link integration. (Rob Aldred)
844
861
  * Wire protocol now supports table arguments, step definition source & regexp, snippets, pending, table diffing (Matt Wynne)
845
862
 
@@ -899,7 +916,7 @@ As usual there are several small features and bug fixes.
899
916
  * New Wire Protocol - allowing out of process execution of Cucumber scenarios. (#428 Matt Wynne)
900
917
  * Added an example illustrating how to get screenshots in HTML reports (examples/watir) (Aslak Hellesøy)
901
918
  * Added new #embed(file, mime_type) method to visitors and Ruby Worlds to make it easier to embed screenshots (Aslak Hellesøy)
902
- * The #puts method available from Ruby Step Definitions will print *after* the step is executed. (#487 Zoltan Penzeli)
919
+ * The #puts method available from Ruby Step Definitions will print*after* the step is executed. (#487 Zoltan Penzeli)
903
920
  * Add support for rolling back transaction for all open database connections. (John Ferlito)
904
921
  * Show scenario and step summary in HTML formatter (#285 Joseph Wilk)
905
922
  * Ast::Table can now be constructed with an Array of Hash. (Aslak Hellesøy)
@@ -952,7 +969,7 @@ The back to stable release. When we went from 0.3.11 to 0.3.90 we thought we wer
952
969
  went nuts and a lot of great contributions came in. Some of those broke backwards compatibility, and we decided it would be
953
970
  better to do this while still on 0.3.x.
954
971
 
955
- Rails users: you *must* run script/generate cucumber after installing this version.
972
+ Rails users: you*must* run script/generate cucumber after installing this version.
956
973
 
957
974
  If something breaks for you, please please please read this file carefully. It's most likely something referenced here, and
958
975
  that will give you more information so you can solve any problems. If not, just get in touch on IRC or the Google Group.
@@ -1044,7 +1061,7 @@ Other noteworthy new features are improved Hook, tags and Transform support, and
1044
1061
  ### New Features
1045
1062
  * Added new internal API for Regexp and groups, allowing other programming languages to leverage native regexps. (Aslak Hellesøy)
1046
1063
  * New @allow_rescue tag for Rails scenarios. Causes exceptions raised in actions to be caught by rails and not bubble up to Cucumber (Aslak Hellesøy)
1047
- * Negative tags can now be used in hooks, just like the command line's --tags option: Before('~@yarr') - will run for all scenarios that *don't* have the @yarr tag. (Aslak Hellesøy)
1064
+ * Negative tags can now be used in hooks, just like the command line's --tags option: Before('~@yarr') - will run for all scenarios that*don't* have the @yarr tag. (Aslak Hellesøy)
1048
1065
  * Transform has current "World" scope (Larry Diehl)
1049
1066
  * Other Transforms can be reused by calling Transform with a string inside of another Transform definition (Larry Diehl)
1050
1067
  * Execute "After" hooks in reverse order of declaration for better behavior with dependent blocks and to mimic the behavior of at_exit (David Waite)
@@ -1058,7 +1075,7 @@ Other noteworthy new features are improved Hook, tags and Transform support, and
1058
1075
  * Cucumber with Spork breaks on OS X Snow Leopard (#431 David Chelimsky)
1059
1076
 
1060
1077
  ### Changed Features
1061
- * Tag names passed on the command line *always* have to use the @ sign. --tags foo or --tags ~bar won't work. Use --tags @foo or --tags ~@bar (Aslak Hellesøy)
1078
+ * Tag names passed on the command line*always* have to use the @ sign. --tags foo or --tags ~bar won't work. Use --tags @foo or --tags ~@bar (Aslak Hellesøy)
1062
1079
 
1063
1080
  ### Removed features
1064
1081
  * The Cucumber::Rails.bypass_rescue no longer exists. Errors will always bubble up, unless you use the new @allow_rescue tag. (Aslak Hellesøy)
@@ -1196,8 +1213,8 @@ You'll achieve better flow this way.
1196
1213
  * Added examples/python that uses rubypython. (Aslak Hellesøy)
1197
1214
  * Checks the number of available colors on the terminal with ruby-terminfo if ruby-terminfo is installed.
1198
1215
  This prevents Apple's Terminal.app from stalling (Yugui - Yuki Sonoda).
1199
- * Set 'xterm-256color' to TERM if your terminal supports grey.
1200
- * ruby-terminfo is available as genki-ruby-terminfo gem from github.
1216
+ * Set 'xterm-256color' to TERM if your terminal supports grey.
1217
+ * ruby-terminfo is available as genki-ruby-terminfo gem from github.
1201
1218
  * Document builtin formatters with --help. (#406 Aslak Hellesøy)
1202
1219
  * Added support for using regular expressions when mapping table headers. (Peter Williams)
1203
1220
 
@@ -1297,7 +1314,7 @@ expected data passed to a step. Here is an example:
1297
1314
  end
1298
1315
 
1299
1316
  You can do the same trick to compare data from a Rails ActiveRecord table (although this is not a
1300
- recommended practice - your Then steps should compare against what users *see*, not what's in the
1317
+ recommended practice - your Then steps should compare against what users*see*, not what's in the
1301
1318
  database):
1302
1319
 
1303
1320
  # This requires that you use the column names in the header of the plain text expected table
@@ -1365,7 +1382,7 @@ thanks to a brand new gem called Spork by Tim Harper and Ben Mabey. (You can fin
1365
1382
  here: http://github.com/timcharper/spork/tree/master). You can start Spork and have it preload your
1366
1383
  application in a separate process. Spork listens for DRb connections, and when you run cucumber with
1367
1384
  --drb the features will run inside the Spork server instead. Spork provides two simple hooks for preloading
1368
- your application - one for framework/stable code (Spork.prefork) and one for the code that *you* write and
1385
+ your application - one for framework/stable code (Spork.prefork) and one for the code that*you* write and
1369
1386
  change often (Spork.each_run). Keep in mind that all World, Before, and other Cucumber hooks need to be
1370
1387
  in the Spork.each_run block. Using Spork works great for Ruby on Rails, which can take a while to load,
1371
1388
  but --drb and Spork aren't tied to Rails at all. The new --drb switch also works great alongside autotest
@@ -1407,7 +1424,7 @@ generator which is fixed in 0.3.9.
1407
1424
  ## [0.3.8](https://github.com/cucumber/cucumber/compare/v0.3.7...v0.3.8)
1408
1425
 
1409
1426
  This Cucumber version fixes several bugs related to Ruby on Rails and RSpec. If you
1410
- use Cucumber with a Rails app we *strongly* recommend you bootstrap Cucumber again:
1427
+ use Cucumber with a Rails app we*strongly* recommend you bootstrap Cucumber again:
1411
1428
 
1412
1429
  ruby script/generate cucumber
1413
1430
 
@@ -1422,7 +1439,7 @@ use Cucumber with a Rails app we *strongly* recommend you bootstrap Cucumber aga
1422
1439
  * The Cucumber Rake task will again fork by default (as 0.3.3 and earlier). Forking must be turned off explicitly. (Aslak Hellesøy)
1423
1440
 
1424
1441
  ### Bugfixes
1425
- * Better coexistence with RSpec - Cucumber now *neuters* the part of RSpec that tries to parse ARGV.
1442
+ * Better coexistence with RSpec - Cucumber now*neuters* the part of RSpec that tries to parse ARGV.
1426
1443
  * The differ= exception is gone (#325, #340 Aslak Hellesøy)
1427
1444
 
1428
1445
  ## [0.3.7](https://github.com/cucumber/cucumber/compare/v0.3.6...v0.3.7)
@@ -1470,7 +1487,7 @@ and there is a brand new JUnit formatter - great for Continuous Integration repo
1470
1487
 
1471
1488
  This release was made especially for the Oslo XP Meetup today.
1472
1489
 
1473
- ** IMPORTANT UPGRADE NOTES FOR RAILS USERS **
1490
+ ** IMPORTANT UPGRADE NOTES FOR RAILS USERS**
1474
1491
 
1475
1492
  Running Cucumber features in the same Ruby interpreter as Rake doesn't seem to work,
1476
1493
  so you have to explicitly tell the task to fork (like it was doing by default in prior
@@ -1610,10 +1627,10 @@ http://wiki.github.com/aslakhellesoy/cucumber/using-rake#profiles
1610
1627
 
1611
1628
  ### Removed/changed features
1612
1629
  * The visitor API has changed slightly:
1613
- * \#visit_step_name, #visit_multiline_arg and \#visit_exception are no longer official API methods.
1614
- * \#visit_step_result replaces those 3 methods.
1615
- * Table and PyString no longer hold status information. Each visitor subclass should store state in @state if needed.
1616
- * \#visit_py_string no longer takes a status argument.
1630
+ * \#visit_step_name, #visit_multiline_arg and \#visit_exception are no longer official API methods.
1631
+ * \#visit_step_result replaces those 3 methods.
1632
+ * Table and PyString no longer hold status information. Each visitor subclass should store state in @state if needed.
1633
+ * \#visit_py_string no longer takes a status argument.
1617
1634
 
1618
1635
  ## [0.2.3](https://github.com/cucumber/cucumber/compare/v0.2.2...v0.2.3)
1619
1636
 
@@ -2063,6 +2080,7 @@ The step definitions for such multiline steps must define an extra block argumen
2063
2080
  * Show the feature file and line for pending steps as a comment when displaying with the pretty formatter. (#40, Joseph Wilk)
2064
2081
 
2065
2082
  ### Bugfixes
2083
+
2066
2084
  * Fixed speling errors in Spanish (Daniel Cadenas)
2067
2085
  * ActionMailer delivery_method should not be set to test (#41, Luke Melia)
2068
2086
  * Reverse incorrectly ordered args in webrat select step (#43, David Chelimsky)
@@ -2070,9 +2088,11 @@ The step definitions for such multiline steps must define an extra block argumen
2070
2088
  * Fixed the HTML Formatter to use actual values for FIT table headers (#30, Joseph Wilk)
2071
2089
 
2072
2090
  ### Removed features
2091
+
2073
2092
  * Removed the /^I go to (.*)$/ step from common_webrat.rb - it's not language agnostic and provides little value.
2074
2093
 
2075
2094
  ### New features
2095
+
2076
2096
  * Added new --out option to make it easier to specify output from Rake and cucumber.yml
2077
2097
 
2078
2098
  ## [0.1.7](https://github.com/cucumber/cucumber/compare/v0.1.6...v0.1.7)
@@ -2118,11 +2138,13 @@ a plain text step is defined. Not anymore! Cucumber will now output this:
2118
2138
  And the result class should be Float # features/steps/calculator_steps.rb:24
2119
2139
 
2120
2140
  ### Bugfixes
2141
+
2121
2142
  * Fixed a bug in the command line args being lost when using --profile (#27, Joseph Wilk)
2122
2143
  * Fixed a bug in Webrat selects (Tim Glen)
2123
2144
  * Fixed parsing of DOS line endings (#2, #28, Aslak Hellesøy)
2124
2145
 
2125
2146
  ### New features
2147
+
2126
2148
  * Steps can be called from other steps (#3, Bryan Helmkamp, Aslak Hellesøy)
2127
2149
  * Added But keyword to all languages (#21, Aslak Hellesøy)
2128
2150
  * Added --no-source option to display step definition location next to step text (#26, Joseph Wilk, Aslak Hellesøy)
@@ -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,17 @@
1
+ # language: ht
2
+ Karakteristik: Adisyon
3
+    Nan lòd pou fè pou evite erè komik
4
+    Kòm yon moun sòt nan matematik
5
+    Mwen ta vle yo dim sòm total nan antre de nimero
6
+
7
+ Plan Senaryo: ajoute de nimero
8
+ Sipoze mwen te antre <input_1> nan kalkilatris la
9
+ Epi mwen te antre <input_2> nan kalkilatris la
10
+ Lè Mwen peze <button>
11
+ Rezilta a ta dwe <output> sou ekran an
12
+
13
+ Egzanp:
14
+ | input_1 | input_2 | button | output |
15
+ | 20 | 30 | ajoute | 50 |
16
+ | 2 | 5 | ajoute | 7 |
17
+ | 0 | 40 | ajoute | 40 |
@@ -0,0 +1,10 @@
1
+ # language: ht
2
+ Karakteristik: Divizyon
3
+    Nan lòd pou fè pou evite erè komik
4
+    Kesye-a dwe kapab kalkile yon fraksyon
5
+
6
+    Senaryo: nimewo regilye
7
+      * Mwen te antre 3 nan kalkilatris la
8
+      * Mwen te antre 2 nan kalkilatris la
9
+      * Mwen peze divize
10
+      * Rezilta a ta dwe 1.5 sou ekran an
@@ -0,0 +1,25 @@
1
+
2
+ # encoding: utf-8
3
+ begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end
4
+ require 'cucumber/formatter/unicode'
5
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
6
+ require 'kalkilatris'
7
+
8
+ Before do
9
+ @kalk = Kalkilatris.new
10
+ end
11
+
12
+ After do
13
+ end
14
+
15
+ Sipoze /Mwen te antre nan (\d+) nan kalkilatris la/ do |n|
16
+ @kalk.push n.to_i
17
+ end
18
+
19
+ Lè /Mwen peze (\w+)/ do |op|
20
+ @result = @kalk.send op
21
+ end
22
+
23
+ Lè sa a /Rezilta a ta dwe (.*) sou ekran an/ do |result|
24
+ @result.should == result.to_f
25
+ end
@@ -0,0 +1,14 @@
1
+ class Kalkilatris
2
+ def push(n)
3
+ @args ||= []
4
+ @args << n
5
+ end
6
+
7
+ def ajoute
8
+ @args.inject(0){|n,sum| sum+=n}
9
+ end
10
+
11
+ def divize
12
+ @args[0].to_f / @args[1].to_f
13
+ end
14
+ end
@@ -22,4 +22,47 @@ Feature: Dry Run
22
22
  1 step (1 skipped)
23
23
  0m0.012s
24
24
 
25
+ """
26
+ Scenario: In the strict mode
27
+ Given a file named "features/test.feature" with:
28
+ """
29
+ Feature: test
30
+ Scenario:
31
+ Given this step fails
32
+ """
33
+ And the standard step definitions
34
+ When I run `cucumber --dry-run --strict`
35
+ Then it should pass with exactly:
36
+ """
37
+ Feature: test
38
+
39
+ Scenario: # features/test.feature:2
40
+ Given this step fails # features/step_definitions/steps.rb:4
41
+
42
+ 1 scenario (1 skipped)
43
+ 1 step (1 skipped)
44
+ 0m0.012s
45
+
46
+ """
47
+ Scenario: In the strict mode with an undefined step
48
+ Given a file named "features/test.feature" with:
49
+ """
50
+ Feature: test
51
+ Scenario:
52
+ Given this step is undefined
53
+ """
54
+ When I run `cucumber --dry-run --strict`
55
+ Then it should fail with:
56
+ """
57
+ Feature: test
58
+
59
+ Scenario: # features/test.feature:2
60
+ Given this step is undefined # features/test.feature:3
61
+ Undefined step: "this step is undefined" (Cucumber::Undefined)
62
+ features/test.feature:3:in `Given this step is undefined'
63
+
64
+ 1 scenario (1 undefined)
65
+ 1 step (1 undefined)
66
+ 0m0.012s
67
+
25
68
  """
@@ -10,8 +10,14 @@ Feature: Strict mode
10
10
  Scenario: Missing
11
11
  Given this step passes
12
12
  """
13
+ And a file named "features/pending.feature" with:
14
+ """
15
+ Feature: Pending
16
+ Scenario: Pending
17
+ Given this step is pending
18
+ """
13
19
 
14
- Scenario: Fail with --strict
20
+ Scenario: Fail with --strict due to undefined step
15
21
  When I run `cucumber -q features/missing.feature --strict`
16
22
  Then it should fail with:
17
23
  """
@@ -26,6 +32,23 @@ Feature: Strict mode
26
32
  1 step (1 undefined)
27
33
  """
28
34
 
35
+ Scenario: Fail with --strict due to pending step
36
+ Given the standard step definitions
37
+ When I run `cucumber -q features/pending.feature --strict`
38
+ Then it should fail with:
39
+ """
40
+ Feature: Pending
41
+
42
+ Scenario: Pending
43
+ Given this step is pending
44
+ TODO (Cucumber::Pending)
45
+ ./features/step_definitions/steps.rb:3:in `/^this step is pending$/'
46
+ features/pending.feature:3:in `Given this step is pending'
47
+
48
+ 1 scenario (1 pending)
49
+ 1 step (1 pending)
50
+ """
51
+
29
52
  Scenario: Succeed with --strict
30
53
  Given the standard step definitions
31
54
  When I run `cucumber -q features/missing.feature --strict`