cucumber 0.1.9 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. data/History.txt +143 -1
  2. data/Manifest.txt +56 -10
  3. data/README.txt +2 -39
  4. data/Rakefile +1 -2
  5. data/bin/cucumber +3 -2
  6. data/config/hoe.rb +2 -1
  7. data/examples/calculator_ruby_features/features/addition.rb +17 -1
  8. data/examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb +1 -1
  9. data/examples/cs/README.textile +1 -22
  10. data/examples/cs/Rakefile +1 -1
  11. data/examples/cs/compile.bat +1 -0
  12. data/examples/cs/features/addition.feature +17 -0
  13. data/examples/cs/features/step_definitons/calculator_steps.rb +23 -0
  14. data/examples/cs/src/demo/Calculator.cs +20 -0
  15. data/examples/i18n/Rakefile +18 -2
  16. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +3 -1
  17. data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +3 -1
  18. data/examples/i18n/de/Rakefile +6 -0
  19. data/examples/i18n/de/features/addition.feature +17 -0
  20. data/examples/i18n/de/features/division.feature +10 -0
  21. data/examples/i18n/de/features/step_definitons/calculator_steps.rb +32 -0
  22. data/examples/i18n/de/lib/calculator.rb +14 -0
  23. data/examples/i18n/en/Rakefile +1 -0
  24. data/examples/i18n/en/features/step_definitons/calculator_steps.rb +3 -6
  25. data/examples/i18n/es/features/step_definitons/calculador_steps.rb +3 -1
  26. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +3 -1
  27. data/examples/i18n/fr/features/addition.feature +13 -11
  28. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +8 -3
  29. data/examples/i18n/id/features/step_definitons/calculator_steps.rb +3 -1
  30. data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +3 -1
  31. data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +4 -1
  32. data/examples/i18n/ko/Rakefile +6 -0
  33. data/examples/i18n/ko/features/addition.feature +17 -0
  34. data/examples/i18n/ko/features/division.feature +11 -0
  35. data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +28 -0
  36. data/examples/i18n/ko/lib/calculator.rb +14 -0
  37. data/examples/i18n/lt/Rakefile +6 -0
  38. data/examples/i18n/lt/features/addition.feature +17 -0
  39. data/examples/i18n/lt/features/division.feature +10 -0
  40. data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +33 -0
  41. data/examples/i18n/lt/lib/calculator.rb +14 -0
  42. data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +3 -1
  43. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +3 -1
  44. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +3 -1
  45. data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +3 -1
  46. data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +3 -1
  47. data/examples/java/features/step_definitons/hello_steps.rb +1 -1
  48. data/examples/java/features/step_definitons/tree_steps.rb +1 -1
  49. data/examples/selenium/features/search.feature +1 -1
  50. data/examples/selenium/features/step_definitons/stories_steps.rb +3 -4
  51. data/examples/self_test/README.textile +3 -0
  52. data/examples/self_test/features/outline_sample.feature +9 -0
  53. data/examples/self_test/features/sample.feature +14 -0
  54. data/examples/self_test/features/step_definitions/sample_steps.rb +13 -0
  55. data/examples/test_unit/Rakefile +6 -0
  56. data/examples/test_unit/features/step_definitions/test_unit_steps.rb +26 -0
  57. data/examples/test_unit/features/test_unit.feature +9 -0
  58. data/examples/tickets/features/lib/eatting_machine.rb +18 -0
  59. data/examples/tickets/features/lib/pantry.rb +20 -0
  60. data/examples/tickets/features/scenario_outline.feature +90 -0
  61. data/examples/tickets/features/step_definitons/scenario_outline_steps.rb +42 -0
  62. data/examples/tickets/features/step_definitons/tickets_steps.rb +5 -1
  63. data/examples/tickets/features/tickets.feature +4 -2
  64. data/examples/watir/README.textile +16 -0
  65. data/examples/watir/features/step_definitons/search_steps.rb +24 -0
  66. data/examples/watir/features/support/env.rb +32 -0
  67. data/features/cucumber_cli.feature +223 -0
  68. data/features/cucumber_cli_outlines.feature +73 -0
  69. data/features/step_definitions/cucumber_steps.rb +27 -0
  70. data/features/step_definitions/extra_steps.rb +2 -0
  71. data/features/support/env.rb +7 -0
  72. data/gem_tasks/deployment.rake +0 -23
  73. data/gem_tasks/fix_cr_lf.rake +1 -1
  74. data/gem_tasks/gemspec.rake +4 -0
  75. data/gem_tasks/rspec.rake +29 -15
  76. data/gem_tasks/treetop.rake +1 -1
  77. data/gem_tasks/yard.rake +8 -0
  78. data/lib/autotest/cucumber_mixin.rb +30 -9
  79. data/lib/autotest/discover.rb +1 -1
  80. data/lib/cucumber/broadcaster.rb +1 -1
  81. data/lib/cucumber/cli.rb +139 -52
  82. data/lib/cucumber/core_ext/exception.rb +20 -0
  83. data/lib/cucumber/core_ext/proc.rb +31 -16
  84. data/lib/cucumber/core_ext/string.rb +7 -0
  85. data/lib/cucumber/executor.rb +62 -27
  86. data/lib/cucumber/formatters/ansicolor.rb +80 -86
  87. data/lib/cucumber/formatters/html_formatter.rb +33 -10
  88. data/lib/cucumber/formatters/pretty_formatter.rb +73 -22
  89. data/lib/cucumber/formatters/progress_formatter.rb +3 -0
  90. data/lib/cucumber/formatters/unicode.rb +35 -0
  91. data/lib/cucumber/languages.yml +43 -5
  92. data/lib/cucumber/model/table.rb +5 -1
  93. data/lib/cucumber/platform.rb +32 -0
  94. data/lib/cucumber/rails/rspec.rb +1 -1
  95. data/lib/cucumber/rails/world.rb +7 -7
  96. data/lib/cucumber/rake/task.rb +7 -2
  97. data/lib/cucumber/step_mother.rb +11 -2
  98. data/lib/cucumber/tree/feature.rb +47 -3
  99. data/lib/cucumber/tree/scenario.rb +85 -3
  100. data/lib/cucumber/tree/step.rb +41 -2
  101. data/lib/cucumber/tree.rb +0 -2
  102. data/lib/cucumber/treetop_parser/feature.treetop.erb +55 -7
  103. data/lib/cucumber/treetop_parser/feature_ar.rb +378 -18
  104. data/lib/cucumber/treetop_parser/feature_cy.rb +378 -18
  105. data/lib/cucumber/treetop_parser/feature_da.rb +378 -18
  106. data/lib/cucumber/treetop_parser/feature_de.rb +386 -26
  107. data/lib/cucumber/treetop_parser/feature_en-lol.rb +1951 -0
  108. data/lib/cucumber/treetop_parser/feature_en-tx.rb +378 -18
  109. data/lib/cucumber/treetop_parser/feature_en.rb +378 -18
  110. data/lib/cucumber/treetop_parser/feature_es.rb +378 -18
  111. data/lib/cucumber/treetop_parser/feature_et.rb +378 -18
  112. data/lib/cucumber/treetop_parser/feature_fr.rb +390 -30
  113. data/lib/cucumber/treetop_parser/feature_id.rb +378 -18
  114. data/lib/cucumber/treetop_parser/feature_it.rb +378 -18
  115. data/lib/cucumber/treetop_parser/feature_ja.rb +378 -18
  116. data/lib/cucumber/treetop_parser/feature_ko.rb +1951 -0
  117. data/lib/cucumber/treetop_parser/feature_lt.rb +1951 -0
  118. data/lib/cucumber/treetop_parser/feature_nl.rb +378 -18
  119. data/lib/cucumber/treetop_parser/feature_no.rb +378 -18
  120. data/lib/cucumber/treetop_parser/feature_parser.rb +3 -1
  121. data/lib/cucumber/treetop_parser/feature_pl.rb +378 -18
  122. data/lib/cucumber/treetop_parser/feature_pt.rb +378 -18
  123. data/lib/cucumber/treetop_parser/feature_ro.rb +378 -18
  124. data/lib/cucumber/treetop_parser/feature_ro2.rb +378 -18
  125. data/lib/cucumber/treetop_parser/feature_ru.rb +378 -18
  126. data/lib/cucumber/treetop_parser/feature_se.rb +378 -18
  127. data/lib/cucumber/treetop_parser/feature_zh-CN.rb +378 -18
  128. data/lib/cucumber/version.rb +3 -2
  129. data/lib/cucumber/world/pending.rb +22 -0
  130. data/lib/cucumber/world.rb +1 -0
  131. data/lib/cucumber.rb +4 -24
  132. data/rails_generators/cucumber/cucumber_generator.rb +1 -0
  133. data/rails_generators/cucumber/templates/env.rb +9 -1
  134. data/rails_generators/cucumber/templates/paths.rb +12 -0
  135. data/rails_generators/cucumber/templates/webrat_steps.rb +61 -8
  136. data/rails_generators/feature/feature_generator.rb +22 -2
  137. data/rails_generators/feature/templates/feature.erb +18 -15
  138. data/rails_generators/feature/templates/steps.erb +16 -14
  139. data/spec/cucumber/cli_spec.rb +285 -6
  140. data/spec/cucumber/executor_spec.rb +202 -42
  141. data/spec/cucumber/formatters/ansicolor_spec.rb +10 -10
  142. data/spec/cucumber/formatters/html_formatter_spec.rb +30 -0
  143. data/spec/cucumber/formatters/pretty_formatter_spec.rb +211 -5
  144. data/spec/cucumber/formatters/profile_formatter_spec.rb +5 -0
  145. data/spec/cucumber/formatters/progress_formatter_spec.rb +16 -0
  146. data/spec/cucumber/model/table_spec.rb +17 -5
  147. data/spec/cucumber/rails/stubs/mini_rails.rb +4 -3
  148. data/spec/cucumber/step_mother_spec.rb +7 -7
  149. data/spec/cucumber/tree/feature_spec.rb +110 -0
  150. data/spec/cucumber/tree/row_scenario_outline_spec.rb +73 -0
  151. data/spec/cucumber/tree/row_scenario_spec.rb +30 -0
  152. data/spec/cucumber/tree/row_step_outline_spec.rb +38 -0
  153. data/spec/cucumber/tree/scenario_outline_spec.rb +50 -0
  154. data/spec/cucumber/tree/scenario_spec.rb +58 -0
  155. data/spec/cucumber/tree/step_outline_spec.rb +17 -0
  156. data/spec/cucumber/tree/step_spec.rb +9 -0
  157. data/spec/cucumber/treetop_parser/empty_scenario_outline.feature +3 -0
  158. data/spec/cucumber/treetop_parser/feature_parser_spec.rb +22 -0
  159. data/spec/cucumber/treetop_parser/invalid_scenario_outlines.feature +7 -0
  160. data/spec/cucumber/treetop_parser/scenario_outline.feature +16 -0
  161. data/spec/cucumber/world/pending_spec.rb +46 -0
  162. data/spec/spec_helper.rb +4 -2
  163. metadata +59 -24
  164. data/TODO.txt +0 -26
  165. data/examples/cs/features/hello.feature +0 -11
  166. data/examples/cs/features/step_definitons/hello_steps.rb +0 -25
  167. data/examples/cs/features/step_definitons/tree_steps.rb +0 -14
  168. data/examples/cs/features/tree.feature +0 -9
  169. data/examples/cs/src/Hello.cs +0 -18
  170. data/examples/java/src/cucumber/demo/Hello.java +0 -16
  171. data/examples/watir/features/step_definitons/stories_steps.rb +0 -51
  172. data/features/see_features.feature +0 -8
  173. data/features/steps/features_steps.rb +0 -9
data/History.txt CHANGED
@@ -1,4 +1,146 @@
1
- == 0.1.9
1
+ == 0.1.16 2009-01-19
2
+
3
+ This is a small bugfix release. The most notable improvement is compatibility with Webrat 0.4. Rails/Webrat users should
4
+ upgrade both Cucumber and Webrat gems.
5
+
6
+ === New features
7
+ * Add the #binary= method back to the Rake task. It is needed by merb_cucumber for running the features of a merb app with it's bundled gems. (Thomas Marek)
8
+ * Added a /^When I go to (.+)$/ step definition to webrat_steps.rb and a simple page name to path mapping method (Bryan Helmkamp)
9
+
10
+ === Bugfixes
11
+ * Fix to run single scenarios when the line number specified doesn't correspond to a step (i.e. blank lines or rows) (#160 Luismi Cavallé)
12
+
13
+ === Removed features
14
+
15
+ == 0.1.15 2009-01-08
16
+
17
+ Bugfix release
18
+
19
+ === New features
20
+ * 한국어! (Korean!) (John Hwang)
21
+
22
+ === Bugfixes
23
+ * --dry-run skips running before/after/steps (#147 Ian Dees)
24
+ * Fix a minor bug in the console formatter's summary (David Chelimsky)
25
+ * Better quoting of Scenario names in Autotest (Peter Jaros)
26
+ * Added some small workarounds for unicode handling on Windows (Aslak Hellesøy)
27
+
28
+ == 0.1.14 2009-01-04
29
+
30
+ This is the first release of Cucumber that runs on Ruby 1.9. There are still some encoding-related issues
31
+ with Arabic (ar), Japanese (ja) and Simplified Chinese (zh-CN). Patches are welcome. Other than that -
32
+ a couple of minor bug fixes and polishing.
33
+
34
+ === New features
35
+ * Pretty formatter shows number of scenarios (#139 Joseph Wilk)
36
+ * Rudimentary support for Ruby 1.9. Now it's ok to file Ruby 1.9-related bugs.
37
+
38
+ === Bugfixes
39
+ * Fixed "No such file or directory -- cucumber (LoadError)" bug with AutoTest (Aslak Hellesøy)
40
+ * Fixed `load_missing_constant': uninitialized constant Dispatcher error with Rails (Aslak Hellesøy)
41
+
42
+ === Removed features
43
+ * The #binary= method is gone from the Rake task. It will always point to the binary in the current gem. (Aslak Hellesøy)
44
+
45
+ == 0.1.13 2008-12-20
46
+
47
+ It's time for some new features again. Output is now much better since you can use diffing, tweak
48
+ the output colours and get the full --backtrace if you want. Managing your support/* files became
49
+ a little easier since they are now always loaded before the step definitions. Life became easier
50
+ for Windows users in Norway (and other countries using unicode in the features). Plus several other
51
+ bug fixes.
52
+
53
+ Enjoy!
54
+
55
+ === New features
56
+ * Console output is no longer bold, but regular. Step arguments are bold instead of blold+underlined. (Aslak Hellesøy)
57
+ * Console output can be configured with CUCUMBER_COLORS in your shell. (Aslak Hellesøy)
58
+ * Added new --backtrace option to show full backtrace (Aslak Hellesøy)
59
+ * Enable RSpec's diffing automatically if RSpec is loaded (Aslak Hellesøy)
60
+ * Files in support directories are loaded before any other file (i.e. step definitions.) (#120, Ben Mabey)
61
+ * The Rails features generator got some love and is now tested: http://github.com/aslakhellesoy/cucumber_rails (Aslak Hellesøy)
62
+ * --language is aliased to -l instead of -a (-l became available when --line was refactored) (Aslak Hellesøy)
63
+ * Scenario Outlines which through placeholders in the steps allow control of how scenario table values are used. (#57 Joseph Wilk)
64
+ * Scenario Outlines are now usable in pure ruby (Joseph Wilk)
65
+ * Add support for calling 'pending' from step definitions. (#112 Joseph Wilk)
66
+
67
+ === Bugfixes
68
+ * Make rails before filters work correctly (#122, #129 Guillermo Álvarez Fernández)
69
+ * Proper Unicode support for Windows command shells: Just require cucumber/formatter/unicode in env.rb (Aslak Hellesøy)
70
+ * Fixed disappearing "a" on Windows (#81 Aslak Hellesøy)
71
+ * Fixed a bug where row step outlines were loosing step tables. (#121 Joseph Wilk, Ben Mabey)
72
+ * The Cucumber Autotest plugin now launches JRuby if autotest is run with JRuby (Aslak Hellesøy)
73
+ * Provide helpful and non-confusing error message when specified profile is blank. (#118, Ben Mabey)
74
+ * Improve handling and error messages for malformed cucumber.yml files. (#117, Ben Mabey)
75
+ * document :x run option in command line help (#114, Aslak Hellesøy)
76
+ * Change 'visits' to 'visit' in features generator to comply with new Webrat API (Darius Roberts)
77
+
78
+ === Removed features
79
+
80
+ == 0.1.12 2008-12-04
81
+
82
+ This is the "getting serious with IronRuby release" - largely based on
83
+ "Patrick Gannon":http://www.patrickgannon.net/archive/2008/10/23/bdd-style-feature-tests-using-ironruby-and-rspeccucumber.aspx's
84
+ blog entry.
85
+
86
+ == New features
87
+ * Cucumber works with IronRuby/.NET - http://github.com/aslakhellesoy/cucumber/wikis/ironruby-and-net (Aslak Hellesøy)
88
+
89
+ == Bugfixes
90
+ * Fixed bug which was preventing coloring under Autotest (#111, Alan Larkin)
91
+
92
+ == Removed features
93
+ None
94
+
95
+ == 0.1.11 2008-12-02
96
+
97
+ Bugfix release with a couple of minor additional features to the command line options.
98
+
99
+ === New features
100
+ * Capture output from cucumber in Autotest (Alan Larkin)
101
+ * Update cucumber generator to work with latest Webrat (Bryan Helkamp)
102
+ * CUCUMBR LIKEZ 2 SPEEK WIF KATS. KTHXBAI (Aimee Daniells)
103
+ * Support for dynamically pluggable formatters (#99 Joseph Wilk)
104
+ * --verbose mode to see ruby files and feature files loaded by Cucumber (#106 Joseph Wilk)
105
+
106
+ === Bugfixes
107
+ * The jcode library is not loaded on JRuby/Rails. Workaround for http://tinyurl.com/55uu3u. (Aslak Hellesøy)
108
+ * Support including modules for class passed to --format (#109 Joseph Wilk)
109
+
110
+ === Removed features
111
+ * The cucumber gem no longer depends on the rspec gem. It must be downloaded manually if RSpec is used. (Jeff Rafter)
112
+
113
+ == 0.1.10 2008-11-25
114
+
115
+ This release mostly has smaller bugfixes. The most significant new feature is how
116
+ line numbers are specified. You can now run multiple features at specific lines numbers like this:
117
+
118
+ cucumber foo.feature:15 bar.feature:6:45:111
119
+
120
+ This will run foo.feature at line 15 and bar.feature at line 6, 45 and 111.
121
+
122
+ === New features
123
+ * Added example showing how to use Cucumber with Test::Unit + Matchy instead of RSpec (Aslak Hellesøy)
124
+ * Yield existing world object to World block (#87 Aslak Hellesøy)
125
+ * AUTOFEATURE=tRue works (case insensitive) (Aslak Hellesøy)
126
+ * Initial support for .NET via IronRuby. (Aslak Hellesøy)
127
+ * Lithuanian translation (sauliusgrigaitis)
128
+ * New webrat step defintions to wrap the new selects_time, selects_date, and selects_datetime methods. (Ben Mabey)
129
+ * Try to load webrat gem if it's not installed as a plugin (Aslak Hellesøy)
130
+ * Support example.feature:20 or example.feature:10:20:30 syntax for running features at specific line number(s). (#88 Joseph Wilk)
131
+
132
+ === Bugfixes
133
+ * Windows - all the 'a' characters in the output have gone on strike (#81 Luis Lavena, Joseph Wilk, Aslak Hellesøy)
134
+ * Raise a nice error when encountering step definition without block (#95 Aslak Hellesøy)
135
+ * Features written using Ruby where breaking due to missing a line number (#91 Joseph Wilk)
136
+ * Directly creating a Table meant the scenario table header was never set which was causing a formatter error (#91 Joseph Wilk)
137
+
138
+ === Removed features
139
+ * $KCODE='u' is no longer done automatically. Developers should do that explicitly when needed in step definitions or env.rb.
140
+ * Step definition without a block being treated as pending (#64 Joseph Wilk)
141
+ * The --line option has been removed. Use the new file.feature:line format instead.
142
+
143
+ == 0.1.9 2008-11-12
2
144
 
3
145
  With this release Cucumber supports 19 (!) natural languages:
4
146
 
data/Manifest.txt CHANGED
@@ -3,7 +3,6 @@ License.txt
3
3
  Manifest.txt
4
4
  README.txt
5
5
  Rakefile
6
- TODO.txt
7
6
  bin/cucumber
8
7
  config/hoe.rb
9
8
  config/requirements.rb
@@ -13,11 +12,10 @@ examples/calculator_ruby_features/features/addition.rb
13
12
  examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb
14
13
  examples/cs/README.textile
15
14
  examples/cs/Rakefile
16
- examples/cs/features/hello.feature
17
- examples/cs/features/step_definitons/hello_steps.rb
18
- examples/cs/features/step_definitons/tree_steps.rb
19
- examples/cs/features/tree.feature
20
- examples/cs/src/Hello.cs
15
+ examples/cs/compile.bat
16
+ examples/cs/features/addition.feature
17
+ examples/cs/features/step_definitons/calculator_steps.rb
18
+ examples/cs/src/demo/Calculator.cs
21
19
  examples/dos_line_endings/Rakefile
22
20
  examples/dos_line_endings/features/dos_line_endings.feature
23
21
  examples/i18n/README.textile
@@ -30,6 +28,11 @@ examples/i18n/da/Rakefile
30
28
  examples/i18n/da/features/step_definitons/kalkulator_steps.rb
31
29
  examples/i18n/da/features/summering.feature
32
30
  examples/i18n/da/lib/kalkulator.rb
31
+ examples/i18n/de/Rakefile
32
+ examples/i18n/de/features/addition.feature
33
+ examples/i18n/de/features/division.feature
34
+ examples/i18n/de/features/step_definitons/calculator_steps.rb
35
+ examples/i18n/de/lib/calculator.rb
33
36
  examples/i18n/en/Rakefile
34
37
  examples/i18n/en/features/addition.feature
35
38
  examples/i18n/en/features/division.feature
@@ -62,6 +65,16 @@ examples/i18n/ja/features/addition.feature
62
65
  examples/i18n/ja/features/division.feature
63
66
  examples/i18n/ja/features/step_definitons/calculator_steps.rb
64
67
  examples/i18n/ja/lib/calculator.rb
68
+ examples/i18n/ko/Rakefile
69
+ examples/i18n/ko/features/addition.feature
70
+ examples/i18n/ko/features/division.feature
71
+ examples/i18n/ko/features/step_definitons/calculator_steps.rb
72
+ examples/i18n/ko/lib/calculator.rb
73
+ examples/i18n/lt/Rakefile
74
+ examples/i18n/lt/features/addition.feature
75
+ examples/i18n/lt/features/division.feature
76
+ examples/i18n/lt/features/step_definitons/calculator_steps.rb
77
+ examples/i18n/lt/lib/calculator.rb
65
78
  examples/i18n/no/Rakefile
66
79
  examples/i18n/no/features/step_definitons/kalkulator_steps.rb
67
80
  examples/i18n/no/features/summering.feature
@@ -88,19 +101,34 @@ examples/java/features/hello.feature
88
101
  examples/java/features/step_definitons/hello_steps.rb
89
102
  examples/java/features/step_definitons/tree_steps.rb
90
103
  examples/java/features/tree.feature
91
- examples/java/src/cucumber/demo/Hello.java
92
104
  examples/selenium/Rakefile
93
105
  examples/selenium/features/search.feature
94
106
  examples/selenium/features/step_definitons/stories_steps.rb
107
+ examples/self_test/README.textile
108
+ examples/self_test/features/outline_sample.feature
109
+ examples/self_test/features/sample.feature
110
+ examples/self_test/features/step_definitions/sample_steps.rb
111
+ examples/test_unit/Rakefile
112
+ examples/test_unit/features/step_definitions/test_unit_steps.rb
113
+ examples/test_unit/features/test_unit.feature
95
114
  examples/tickets/Rakefile
96
115
  examples/tickets/cucumber.yml
116
+ examples/tickets/features/lib/eatting_machine.rb
117
+ examples/tickets/features/lib/pantry.rb
118
+ examples/tickets/features/scenario_outline.feature
119
+ examples/tickets/features/step_definitons/scenario_outline_steps.rb
97
120
  examples/tickets/features/step_definitons/tickets_steps.rb
98
121
  examples/tickets/features/tickets.feature
122
+ examples/watir/README.textile
99
123
  examples/watir/Rakefile
100
124
  examples/watir/features/search.feature
101
- examples/watir/features/step_definitons/stories_steps.rb
102
- features/see_features.feature
103
- features/steps/features_steps.rb
125
+ examples/watir/features/step_definitons/search_steps.rb
126
+ examples/watir/features/support/env.rb
127
+ features/cucumber_cli.feature
128
+ features/cucumber_cli_outlines.feature
129
+ features/step_definitions/cucumber_steps.rb
130
+ features/step_definitions/extra_steps.rb
131
+ features/support/env.rb
104
132
  gem_tasks/deployment.rake
105
133
  gem_tasks/environment.rake
106
134
  gem_tasks/features.rake
@@ -109,6 +137,7 @@ gem_tasks/flog.rake
109
137
  gem_tasks/gemspec.rake
110
138
  gem_tasks/rspec.rake
111
139
  gem_tasks/treetop.rake
140
+ gem_tasks/yard.rake
112
141
  lib/autotest/cucumber.rb
113
142
  lib/autotest/cucumber_mixin.rb
114
143
  lib/autotest/cucumber_rails.rb
@@ -118,6 +147,7 @@ lib/autotest/discover.rb
118
147
  lib/cucumber.rb
119
148
  lib/cucumber/broadcaster.rb
120
149
  lib/cucumber/cli.rb
150
+ lib/cucumber/core_ext/exception.rb
121
151
  lib/cucumber/core_ext/proc.rb
122
152
  lib/cucumber/core_ext/string.rb
123
153
  lib/cucumber/executor.rb
@@ -131,9 +161,11 @@ lib/cucumber/formatters/jquery.js
131
161
  lib/cucumber/formatters/pretty_formatter.rb
132
162
  lib/cucumber/formatters/profile_formatter.rb
133
163
  lib/cucumber/formatters/progress_formatter.rb
164
+ lib/cucumber/formatters/unicode.rb
134
165
  lib/cucumber/languages.yml
135
166
  lib/cucumber/model.rb
136
167
  lib/cucumber/model/table.rb
168
+ lib/cucumber/platform.rb
137
169
  lib/cucumber/rails/rspec.rb
138
170
  lib/cucumber/rails/world.rb
139
171
  lib/cucumber/rake/task.rb
@@ -152,6 +184,7 @@ lib/cucumber/treetop_parser/feature_ar.rb
152
184
  lib/cucumber/treetop_parser/feature_cy.rb
153
185
  lib/cucumber/treetop_parser/feature_da.rb
154
186
  lib/cucumber/treetop_parser/feature_de.rb
187
+ lib/cucumber/treetop_parser/feature_en-lol.rb
155
188
  lib/cucumber/treetop_parser/feature_en-tx.rb
156
189
  lib/cucumber/treetop_parser/feature_en.rb
157
190
  lib/cucumber/treetop_parser/feature_es.rb
@@ -160,6 +193,8 @@ lib/cucumber/treetop_parser/feature_fr.rb
160
193
  lib/cucumber/treetop_parser/feature_id.rb
161
194
  lib/cucumber/treetop_parser/feature_it.rb
162
195
  lib/cucumber/treetop_parser/feature_ja.rb
196
+ lib/cucumber/treetop_parser/feature_ko.rb
197
+ lib/cucumber/treetop_parser/feature_lt.rb
163
198
  lib/cucumber/treetop_parser/feature_nl.rb
164
199
  lib/cucumber/treetop_parser/feature_no.rb
165
200
  lib/cucumber/treetop_parser/feature_parser.rb
@@ -171,11 +206,14 @@ lib/cucumber/treetop_parser/feature_ru.rb
171
206
  lib/cucumber/treetop_parser/feature_se.rb
172
207
  lib/cucumber/treetop_parser/feature_zh-CN.rb
173
208
  lib/cucumber/version.rb
209
+ lib/cucumber/world.rb
210
+ lib/cucumber/world/pending.rb
174
211
  rails_generators/cucumber/USAGE
175
212
  rails_generators/cucumber/cucumber_generator.rb
176
213
  rails_generators/cucumber/templates/cucumber
177
214
  rails_generators/cucumber/templates/cucumber.rake
178
215
  rails_generators/cucumber/templates/env.rb
216
+ rails_generators/cucumber/templates/paths.rb
179
217
  rails_generators/cucumber/templates/webrat_steps.rb
180
218
  rails_generators/feature/USAGE
181
219
  rails_generators/feature/feature_generator.rb
@@ -209,18 +247,26 @@ spec/cucumber/rails/world_spec.rb
209
247
  spec/cucumber/sell_cucumbers.feature
210
248
  spec/cucumber/step_mother_spec.rb
211
249
  spec/cucumber/tree/feature_spec.rb
250
+ spec/cucumber/tree/row_scenario_outline_spec.rb
212
251
  spec/cucumber/tree/row_scenario_spec.rb
252
+ spec/cucumber/tree/row_step_outline_spec.rb
253
+ spec/cucumber/tree/scenario_outline_spec.rb
213
254
  spec/cucumber/tree/scenario_spec.rb
255
+ spec/cucumber/tree/step_outline_spec.rb
214
256
  spec/cucumber/tree/step_spec.rb
215
257
  spec/cucumber/treetop_parser/empty_feature.feature
216
258
  spec/cucumber/treetop_parser/empty_scenario.feature
259
+ spec/cucumber/treetop_parser/empty_scenario_outline.feature
217
260
  spec/cucumber/treetop_parser/feature_parser_spec.rb
218
261
  spec/cucumber/treetop_parser/fit_scenario.feature
219
262
  spec/cucumber/treetop_parser/given_scenario.feature
263
+ spec/cucumber/treetop_parser/invalid_scenario_outlines.feature
220
264
  spec/cucumber/treetop_parser/multiline_steps.feature
221
265
  spec/cucumber/treetop_parser/multiple_tables.feature
266
+ spec/cucumber/treetop_parser/scenario_outline.feature
222
267
  spec/cucumber/treetop_parser/spaces.feature
223
268
  spec/cucumber/treetop_parser/test_dos.feature
224
269
  spec/cucumber/treetop_parser/with_comments.feature
270
+ spec/cucumber/world/pending_spec.rb
225
271
  spec/spec.opts
226
272
  spec/spec_helper.rb
data/README.txt CHANGED
@@ -1,41 +1,4 @@
1
1
  = Cucumber
2
2
 
3
- * http://github.com/aslakhellesoy/cucumber
4
-
5
- == DESCRIPTION:
6
-
7
- Cucumber executes plain text documentation of code against that code.
8
- Documentation: http://github.com/aslakhellesoy/cucumber/wikis/home
9
-
10
- == REQUIREMENTS:
11
-
12
- * FIX (list of requirements)
13
-
14
- == INSTALL:
15
-
16
- * gem install cucumber
17
-
18
- == LICENSE:
19
-
20
- (The MIT License)
21
-
22
- Copyright (c) 2008 Aslak Hellesøy
23
-
24
- Permission is hereby granted, free of charge, to any person obtaining
25
- a copy of this software and associated documentation files (the
26
- 'Software'), to deal in the Software without restriction, including
27
- without limitation the rights to use, copy, modify, merge, publish,
28
- distribute, sublicense, and/or sell copies of the Software, and to
29
- permit persons to whom the Software is furnished to do so, subject to
30
- the following conditions:
31
-
32
- The above copyright notice and this permission notice shall be
33
- included in all copies or substantial portions of the Software.
34
-
35
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
36
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
37
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
38
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
39
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
40
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
41
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3
+ The main website is at http://cukes.info/
4
+ The documentation is at http://github.com/aslakhellesoy/cucumber/wikis/home/
data/Rakefile CHANGED
@@ -5,5 +5,4 @@ require 'config/hoe' # setup Hoe + all gem configuration
5
5
  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
- Rake::Task[:default].clear_prerequisites
9
- task :default => [:spec, :features]
8
+ Rake::Task[:default].clear_prerequisites
data/bin/cucumber CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+ # Add '.rb' to work around a bug in IronRuby's File#dirname
3
+ $:.unshift(File.dirname(__FILE__ + '.rb') + '/../lib') unless $:.include?(File.dirname(__FILE__ + '.rb') + '/../lib')
2
4
 
3
- $:.unshift(File.dirname(__FILE__) + '/../lib') unless $:.include?(File.dirname(__FILE__) + '/../lib')
4
5
  require 'cucumber/cli'
5
- Cucumber::CLI.execute
6
+ Cucumber::CLI.execute(ARGV)
data/config/hoe.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  require 'cucumber/version'
2
3
 
3
4
  AUTHOR = 'Aslak Hellesøy' # can also be an array of Authors
@@ -57,7 +58,7 @@ $hoe = Hoe.new(GEM_NAME, VERS) do |p|
57
58
  # == Optional
58
59
  p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
59
60
  #p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
60
- p.extra_deps = [ ['term-ansicolor', '>= 1.0.3'], ['treetop', '>= 1.2.4'], ['rspec', '>= 1.1.5'], ['diff-lcs', '>= 1.1.2'] ]
61
+ p.extra_deps = [ ['term-ansicolor', '>= 1.0.3'], ['treetop', '>= 1.2.4'], ['diff-lcs', '>= 1.1.2'] ]
61
62
 
62
63
  #p.spec_extras = {} # A hash of extra values to set in the gemspec.
63
64
 
@@ -10,7 +10,7 @@ Feature %|Addition
10
10
  And "I have entered 70 into the calculator"
11
11
  When "I add"
12
12
  Then "the result should be 120 on the screen"
13
- And "the result class should be Float"
13
+ And "the result class should be Fixnum"
14
14
  end
15
15
 
16
16
  Table do |t|
@@ -20,4 +20,20 @@ Feature %|Addition
20
20
  t | n | n*2 | n*3 | Fixnum | t
21
21
  end
22
22
  end
23
+
24
+ ScenarioOutline "Add two numbers" do
25
+ Given "I have entered <input_1> into the calculator"
26
+ And "I have entered <input_2> into the calculator"
27
+ When "I add"
28
+ Then "the result should be <output> on the screen"
29
+ And "the result class should be <class>"
30
+ end
31
+
32
+ Table do |t|
33
+ t | "input_1" | "input_2" | "output" | "class" | t
34
+ 10.times do |n|
35
+ t | n | n*2 | n*3 | Fixnum | t
36
+ end
37
+ end
38
+
23
39
  end
@@ -1,4 +1,4 @@
1
- require 'spec'
1
+ require 'spec/expectations'
2
2
 
3
3
  class Calculator
4
4
  def push(n)
@@ -1,22 +1 @@
1
- h1. Using Cucumber with Java
2
-
3
- This directory contains code to demonstrate how Cucumber can be used to develop Java code.
4
- You need JRuby 1.1.3 or higher installed and JRuby's bin directory on your PATH.
5
-
6
- h2. Installing required gems
7
-
8
- jruby -S gem install aslakhellesoy-cucumber
9
- jruby -S gem install diff-lcs
10
-
11
- h2. Running the scenarios
12
-
13
- Open a shell in this directory (java) and execute the following command:
14
-
15
- <pre><code>
16
- jruby -S rake features
17
- </code></pre>
18
-
19
- This will compile the java code and package it in a jar file, and then run Cucumber against
20
- that code.
21
-
22
- There is a deliberate error. See if you can fix it!
1
+ See "IronRuby and .NET":http://github.com/aslakhellesoy/cucumber/wikis/ironruby-and-net
data/examples/cs/Rakefile CHANGED
@@ -8,5 +8,5 @@ end
8
8
  task :features => :compile
9
9
 
10
10
  task :compile do
11
- sh "csc /target:library /out:Cucumber.Demo.dll src\\Hello.cs"
11
+ sh "csc /target:library /out:Demo.dll src\\demo\\Calculator.cs"
12
12
  end
@@ -0,0 +1 @@
1
+ csc /target:library /out:Calculator.dll src\demo\Calculator.cs
@@ -0,0 +1,17 @@
1
+ Feature: Addition
2
+ In order to avoid silly mistakes
3
+ As a math idiot
4
+ I want to be told the sum of two numbers
5
+
6
+ Scenario: Add two numbers
7
+ Given I have entered 50 into the calculator
8
+ And I have entered 70 into the calculator
9
+ When I press add
10
+ Then the result should be 120 on the screen
11
+ And the result class should be Fixnum
12
+
13
+ More Examples:
14
+ | input_1 | input_2 | output | class |
15
+ | 20 | 30 | 50 | Fixnum |
16
+ | 2 | 5 | 7 | Fixnum |
17
+ | 0 | 40 | 40 | Fixnum |
@@ -0,0 +1,23 @@
1
+ require 'spec/expectations'
2
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'Calculator'
4
+
5
+ Before do
6
+ @calc = Demo::Calculator.new
7
+ end
8
+
9
+ Given "I have entered $n into the calculator" do |n|
10
+ @calc.push n.to_i
11
+ end
12
+
13
+ When /I press add/ do
14
+ @result = @calc.Add
15
+ end
16
+
17
+ Then /the result should be (.*) on the screen/ do |result|
18
+ @result.should == result.to_i
19
+ end
20
+
21
+ Then /the result class should be (\w*)/ do |class_name|
22
+ @result.class.name.should == class_name
23
+ end
@@ -0,0 +1,20 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+
4
+ namespace Demo {
5
+ public class Calculator {
6
+ private List<int>args = new List<int>();
7
+
8
+ public void Push(int n) {
9
+ args.Add(n);
10
+ }
11
+
12
+ public int Add() {
13
+ int result = 0;
14
+ foreach(int n in args) {
15
+ result += n;
16
+ }
17
+ return result;
18
+ }
19
+ }
20
+ }
@@ -4,13 +4,29 @@ task :i18n do
4
4
  Dir["#{dir}/*"].each do |f|
5
5
  if File.directory?(f)
6
6
  lang = f[dir.length+1..-1]
7
- Dir.chdir(f) do
8
- rake("features")
7
+ if supported?(lang)
8
+ Dir.chdir(f) do
9
+ rake("features")
10
+ end
11
+ else
12
+ STDERR.puts %{
13
+ !!!!!
14
+ !!!!! SKIPPING #{lang} (Haven't made it work on Ruby 1.9 yet)
15
+ !!!!!
16
+ }
9
17
  end
10
18
  end
11
19
  end
12
20
  end
13
21
 
22
+ def supported?(lang)
23
+ if RUBY_VERSION =~ /^1\.9/
24
+ !%w{ar ja ko zh-CN}.index(lang)
25
+ else
26
+ true
27
+ end
28
+ end
29
+
14
30
  def rake(args)
15
31
  ruby(File.join(Gem.bindir, 'rake'), args)
16
32
  end
@@ -1,5 +1,7 @@
1
- require 'spec'
1
+ # encoding: utf-8
2
+ require 'spec/expectations'
2
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
4
+ require 'cucumber/formatters/unicode'
3
5
  require 'calculator'
4
6
 
5
7
  Before do
@@ -1,5 +1,7 @@
1
- require 'spec'
1
+ # encoding: utf-8
2
+ require 'spec/expectations'
2
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
4
+ require 'cucumber/formatters/unicode'
3
5
  require 'kalkulator'
4
6
 
5
7
  Before do
@@ -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 = "--language de"
6
+ end
@@ -0,0 +1,17 @@
1
+ Funktionalität: Addition
2
+ Um dumme Fehler zu vermeiden
3
+ möchte ich als Matheidiot
4
+ die Summe zweier Zahlen gesagt bekommen
5
+
6
+ Szenario: Zwei Zahlen hinzufügen
7
+ Gegeben sei ich habe 50 in den Taschenrechner eingegeben
8
+ Und ich habe 70 in den Taschenrechner eingegeben
9
+ Wenn ich add drücke
10
+ Dann sollte das Ergebniss auf dem Bildschirm 120 sein
11
+ Und die Ergebnissklasse sollte eine Fixnum sein
12
+
13
+ Mehr Beispiele:
14
+ | Eingabe_1 | Eingabe_2 | Knopf | Ausgabe | Klasse |
15
+ | 20 | 30 | add | 50 | Fixnum |
16
+ | 2 | 5 | add | 7 | Fixnum |
17
+ | 0 | 40 | add | 40 | Fixnum |
@@ -0,0 +1,10 @@
1
+ Funktionalität: Division
2
+ Um dumme Fehler zu vermeiden
3
+ müssen Kassierer in der Lage sein einen Bruchteil zu berechnen
4
+
5
+ Szenario: Normale Zahlen
6
+ Gegeben sei ich habe 3 in den Taschenrechner eingegeben
7
+ Und ich habe 2 in den Taschenrechner eingegeben
8
+ Wenn ich divide drücke
9
+ Dann sollte das Ergebniss auf dem Bildschirm 1.5 sein
10
+ Und die Ergebnissklasse sollte eine Float sein
@@ -0,0 +1,32 @@
1
+ # encoding: utf-8
2
+ require 'spec/expectations'
3
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
4
+ require 'cucumber/formatters/unicode'
5
+ require 'calculator'
6
+
7
+ Before do
8
+ @calc = Calculator.new
9
+ end
10
+
11
+ After do
12
+ end
13
+
14
+ Given "ich habe $n in den Taschenrechner eingegeben" do |n|
15
+ @calc.push n.to_i
16
+ end
17
+
18
+ When /ich (\w+) drücke/ do |op|
19
+ @result = @calc.send op
20
+ end
21
+
22
+ Then /sollte das Ergebniss auf dem Bildschirm (.*) sein/ do |result|
23
+ @result.should == result.to_f
24
+ end
25
+
26
+ Then /die Ergebnissklasse sollte eine (\w*) sein/ do |class_name|
27
+ @result.class.name.should == class_name
28
+ end
29
+
30
+ Given /it should rain on (\w+)/ do |day|
31
+ @calc.rain?(day).should == true
32
+ end