cucumber 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/History.txt +38 -3
  2. data/Manifest.txt +17 -1
  3. data/README.txt +2 -39
  4. data/bin/cucumber +1 -1
  5. data/examples/calculator_ruby_features/features/addition.rb +16 -0
  6. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -1
  7. data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +1 -0
  8. data/examples/i18n/de/features/step_definitons/calculator_steps.rb +1 -0
  9. data/examples/i18n/en/features/step_definitons/calculator_steps.rb +1 -0
  10. data/examples/i18n/es/features/step_definitons/calculador_steps.rb +1 -0
  11. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +1 -0
  12. data/examples/i18n/fr/features/addition.feature +13 -11
  13. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +6 -2
  14. data/examples/i18n/id/features/step_definitons/calculator_steps.rb +1 -0
  15. data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +1 -0
  16. data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +2 -0
  17. data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +1 -0
  18. data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +1 -0
  19. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +1 -0
  20. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +1 -0
  21. data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +1 -0
  22. data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +1 -0
  23. data/examples/selenium/features/search.feature +1 -1
  24. data/examples/selenium/features/step_definitons/stories_steps.rb +2 -3
  25. data/examples/tickets/features/lib/eatting_machine.rb +18 -0
  26. data/examples/tickets/features/lib/pantry.rb +20 -0
  27. data/examples/tickets/features/scenario_outline.feature +64 -0
  28. data/examples/tickets/features/step_definitons/scenario_outline_steps.rb +34 -0
  29. data/examples/tickets/features/step_definitons/tickets_steps.rb +4 -0
  30. data/gem_tasks/fix_cr_lf.rake +1 -1
  31. data/gem_tasks/yard.rake +8 -0
  32. data/lib/autotest/cucumber_mixin.rb +3 -3
  33. data/lib/cucumber.rb +2 -0
  34. data/lib/cucumber/broadcaster.rb +1 -1
  35. data/lib/cucumber/cli.rb +87 -42
  36. data/lib/cucumber/core_ext/exception.rb +20 -0
  37. data/lib/cucumber/core_ext/string.rb +1 -1
  38. data/lib/cucumber/executor.rb +35 -18
  39. data/lib/cucumber/formatters/ansicolor.rb +65 -74
  40. data/lib/cucumber/formatters/html_formatter.rb +33 -10
  41. data/lib/cucumber/formatters/pretty_formatter.rb +58 -16
  42. data/lib/cucumber/formatters/progress_formatter.rb +3 -0
  43. data/lib/cucumber/formatters/unicode.rb +27 -0
  44. data/lib/cucumber/languages.yml +6 -4
  45. data/lib/cucumber/platform.rb +1 -0
  46. data/lib/cucumber/rails/world.rb +6 -6
  47. data/lib/cucumber/step_mother.rb +3 -0
  48. data/lib/cucumber/tree/feature.rb +28 -2
  49. data/lib/cucumber/tree/scenario.rb +62 -1
  50. data/lib/cucumber/tree/step.rb +32 -1
  51. data/lib/cucumber/treetop_parser/feature.treetop.erb +54 -7
  52. data/lib/cucumber/treetop_parser/feature_ar.rb +377 -18
  53. data/lib/cucumber/treetop_parser/feature_cy.rb +377 -18
  54. data/lib/cucumber/treetop_parser/feature_da.rb +377 -18
  55. data/lib/cucumber/treetop_parser/feature_de.rb +377 -18
  56. data/lib/cucumber/treetop_parser/feature_en-lol.rb +377 -18
  57. data/lib/cucumber/treetop_parser/feature_en-tx.rb +377 -18
  58. data/lib/cucumber/treetop_parser/feature_en.rb +377 -18
  59. data/lib/cucumber/treetop_parser/feature_es.rb +377 -18
  60. data/lib/cucumber/treetop_parser/feature_et.rb +377 -18
  61. data/lib/cucumber/treetop_parser/feature_fr.rb +389 -30
  62. data/lib/cucumber/treetop_parser/feature_id.rb +377 -18
  63. data/lib/cucumber/treetop_parser/feature_it.rb +377 -18
  64. data/lib/cucumber/treetop_parser/feature_ja.rb +377 -18
  65. data/lib/cucumber/treetop_parser/feature_lt.rb +377 -18
  66. data/lib/cucumber/treetop_parser/feature_nl.rb +377 -18
  67. data/lib/cucumber/treetop_parser/feature_no.rb +377 -18
  68. data/lib/cucumber/treetop_parser/feature_pl.rb +377 -18
  69. data/lib/cucumber/treetop_parser/feature_pt.rb +377 -18
  70. data/lib/cucumber/treetop_parser/feature_ro.rb +377 -18
  71. data/lib/cucumber/treetop_parser/feature_ro2.rb +377 -18
  72. data/lib/cucumber/treetop_parser/feature_ru.rb +377 -18
  73. data/lib/cucumber/treetop_parser/feature_se.rb +377 -18
  74. data/lib/cucumber/treetop_parser/feature_zh-CN.rb +377 -18
  75. data/lib/cucumber/version.rb +1 -1
  76. data/lib/cucumber/world.rb +1 -0
  77. data/lib/cucumber/world/pending.rb +22 -0
  78. data/rails_generators/cucumber/templates/env.rb +1 -0
  79. data/rails_generators/feature/feature_generator.rb +22 -2
  80. data/rails_generators/feature/templates/feature.erb +15 -12
  81. data/rails_generators/feature/templates/steps.erb +16 -14
  82. data/spec/cucumber/cli_spec.rb +87 -6
  83. data/spec/cucumber/executor_spec.rb +102 -30
  84. data/spec/cucumber/formatters/ansicolor_spec.rb +10 -10
  85. data/spec/cucumber/formatters/html_formatter_spec.rb +30 -0
  86. data/spec/cucumber/formatters/pretty_formatter_spec.rb +139 -4
  87. data/spec/cucumber/formatters/progress_formatter_spec.rb +16 -0
  88. data/spec/cucumber/tree/feature_spec.rb +84 -5
  89. data/spec/cucumber/tree/row_scenario_outline_spec.rb +73 -0
  90. data/spec/cucumber/tree/row_step_outline_spec.rb +38 -0
  91. data/spec/cucumber/tree/scenario_outline_spec.rb +50 -0
  92. data/spec/cucumber/tree/step_outline_spec.rb +17 -0
  93. data/spec/cucumber/tree/step_spec.rb +9 -0
  94. data/spec/cucumber/treetop_parser/empty_scenario_outline.feature +3 -0
  95. data/spec/cucumber/treetop_parser/feature_parser_spec.rb +22 -0
  96. data/spec/cucumber/treetop_parser/invalid_scenario_outlines.feature +7 -0
  97. data/spec/cucumber/treetop_parser/scenario_outline.feature +16 -0
  98. data/spec/cucumber/world/pending_spec.rb +46 -0
  99. data/spec/spec_helper.rb +2 -1
  100. metadata +19 -4
  101. data/TODO.txt +0 -26
@@ -1,3 +1,38 @@
1
+ == 0.1.13 2008-12-20
2
+
3
+ It's time for some new features again. Output is now much better since you can use diffing, tweak
4
+ the output colours and get the full --backtrace if you want. Managing your support/* files became
5
+ a little easier since they are now always loaded before the step definitions. Life became easier
6
+ for Windows users in Norway (and other countries using unicode in the features). Plus several other
7
+ bug fixes.
8
+
9
+ Enjoy!
10
+
11
+ === New features
12
+ * Console output is no longer bold, but regular. Step arguments are bold instead of blold+underlined. (Aslak Hellesøy)
13
+ * Console output can be configured with CUCUMBER_COLORS in your shell. (Aslak Hellesøy)
14
+ * Added new --backtrace option to show full backtrace (Aslak Hellesøy)
15
+ * Enable RSpec's diffing automatically if RSpec is loaded (Aslak Hellesøy)
16
+ * Files in support directories are loaded before any other file (i.e. step definitions.) (#120, Ben Mabey)
17
+ * The Rails features generator got some love and is now tested: http://github.com/aslakhellesoy/cucumber_rails (Aslak Hellesøy)
18
+ * --language is aliased to -l instead of -a (-l became available when --line was refactored) (Aslak Hellesøy)
19
+ * Scenario Outlines which through placeholders in the steps allow control of how scenario table values are used. (#57 Joseph Wilk)
20
+ * Scenario Outlines are now usable in pure ruby (Joseph Wilk)
21
+ * Add support for calling 'pending' from step definitions. (#112 Joseph Wilk)
22
+
23
+ === Bugfixes
24
+ * Make rails before filters work correctly (#122, #129 Guillermo Álvarez Fernández)
25
+ * Proper Unicode support for Windows command shells: Just require cucumber/formatter/unicode in env.rb (Aslak Hellesøy)
26
+ * Fixed disappearing "a" on Windows (#81 Aslak Hellesøy)
27
+ * Fixed a bug where row step outlines were loosing step tables. (#121 Joseph Wilk, Ben Mabey)
28
+ * The Cucumber Autotest plugin now launches JRuby if autotest is run with JRuby (Aslak Hellesøy)
29
+ * Provide helpful and non-confusing error message when specified profile is blank. (#118, Ben Mabey)
30
+ * Improve handling and error messages for malformed cucumber.yml files. (#117, Ben Mabey)
31
+ * document :x run option in command line help (#114, Aslak Hellesøy)
32
+ * Change 'visits' to 'visit' in features generator to comply with new Webrat API (Darius Roberts)
33
+
34
+ === Removed features
35
+
1
36
  == 0.1.12 2008-12-04
2
37
 
3
38
  This is the "getting serious with IronRuby release" - largely based on
@@ -17,18 +52,18 @@ None
17
52
 
18
53
  Bugfix release with a couple of minor additional features to the command line options.
19
54
 
20
- == New features
55
+ === New features
21
56
  * Capture output from cucumber in Autotest (Alan Larkin)
22
57
  * Update cucumber generator to work with latest Webrat (Bryan Helkamp)
23
58
  * CUCUMBR LIKEZ 2 SPEEK WIF KATS. KTHXBAI (Aimee Daniells)
24
59
  * Support for dynamically pluggable formatters (#99 Joseph Wilk)
25
60
  * --verbose mode to see ruby files and feature files loaded by Cucumber (#106 Joseph Wilk)
26
61
 
27
- == Bugfixes
62
+ === Bugfixes
28
63
  * The jcode library is not loaded on JRuby/Rails. Workaround for http://tinyurl.com/55uu3u. (Aslak Hellesøy)
29
64
  * Support including modules for class passed to --format (#109 Joseph Wilk)
30
65
 
31
- == Removed features
66
+ === Removed features
32
67
  * The cucumber gem no longer depends on the rspec gem. It must be downloaded manually if RSpec is used. (Jeff Rafter)
33
68
 
34
69
  == 0.1.10 2008-11-25
@@ -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
@@ -106,6 +105,10 @@ examples/test_unit/features/step_definitions/test_unit_steps.rb
106
105
  examples/test_unit/features/test_unit.feature
107
106
  examples/tickets/Rakefile
108
107
  examples/tickets/cucumber.yml
108
+ examples/tickets/features/lib/eatting_machine.rb
109
+ examples/tickets/features/lib/pantry.rb
110
+ examples/tickets/features/scenario_outline.feature
111
+ examples/tickets/features/step_definitons/scenario_outline_steps.rb
109
112
  examples/tickets/features/step_definitons/tickets_steps.rb
110
113
  examples/tickets/features/tickets.feature
111
114
  examples/watir/Rakefile
@@ -121,6 +124,7 @@ gem_tasks/flog.rake
121
124
  gem_tasks/gemspec.rake
122
125
  gem_tasks/rspec.rake
123
126
  gem_tasks/treetop.rake
127
+ gem_tasks/yard.rake
124
128
  lib/autotest/cucumber.rb
125
129
  lib/autotest/cucumber_mixin.rb
126
130
  lib/autotest/cucumber_rails.rb
@@ -130,6 +134,7 @@ lib/autotest/discover.rb
130
134
  lib/cucumber.rb
131
135
  lib/cucumber/broadcaster.rb
132
136
  lib/cucumber/cli.rb
137
+ lib/cucumber/core_ext/exception.rb
133
138
  lib/cucumber/core_ext/proc.rb
134
139
  lib/cucumber/core_ext/string.rb
135
140
  lib/cucumber/executor.rb
@@ -143,6 +148,7 @@ lib/cucumber/formatters/jquery.js
143
148
  lib/cucumber/formatters/pretty_formatter.rb
144
149
  lib/cucumber/formatters/profile_formatter.rb
145
150
  lib/cucumber/formatters/progress_formatter.rb
151
+ lib/cucumber/formatters/unicode.rb
146
152
  lib/cucumber/languages.yml
147
153
  lib/cucumber/model.rb
148
154
  lib/cucumber/model/table.rb
@@ -186,6 +192,8 @@ lib/cucumber/treetop_parser/feature_ru.rb
186
192
  lib/cucumber/treetop_parser/feature_se.rb
187
193
  lib/cucumber/treetop_parser/feature_zh-CN.rb
188
194
  lib/cucumber/version.rb
195
+ lib/cucumber/world.rb
196
+ lib/cucumber/world/pending.rb
189
197
  rails_generators/cucumber/USAGE
190
198
  rails_generators/cucumber/cucumber_generator.rb
191
199
  rails_generators/cucumber/templates/cucumber
@@ -224,18 +232,26 @@ spec/cucumber/rails/world_spec.rb
224
232
  spec/cucumber/sell_cucumbers.feature
225
233
  spec/cucumber/step_mother_spec.rb
226
234
  spec/cucumber/tree/feature_spec.rb
235
+ spec/cucumber/tree/row_scenario_outline_spec.rb
227
236
  spec/cucumber/tree/row_scenario_spec.rb
237
+ spec/cucumber/tree/row_step_outline_spec.rb
238
+ spec/cucumber/tree/scenario_outline_spec.rb
228
239
  spec/cucumber/tree/scenario_spec.rb
240
+ spec/cucumber/tree/step_outline_spec.rb
229
241
  spec/cucumber/tree/step_spec.rb
230
242
  spec/cucumber/treetop_parser/empty_feature.feature
231
243
  spec/cucumber/treetop_parser/empty_scenario.feature
244
+ spec/cucumber/treetop_parser/empty_scenario_outline.feature
232
245
  spec/cucumber/treetop_parser/feature_parser_spec.rb
233
246
  spec/cucumber/treetop_parser/fit_scenario.feature
234
247
  spec/cucumber/treetop_parser/given_scenario.feature
248
+ spec/cucumber/treetop_parser/invalid_scenario_outlines.feature
235
249
  spec/cucumber/treetop_parser/multiline_steps.feature
236
250
  spec/cucumber/treetop_parser/multiple_tables.feature
251
+ spec/cucumber/treetop_parser/scenario_outline.feature
237
252
  spec/cucumber/treetop_parser/spaces.feature
238
253
  spec/cucumber/treetop_parser/test_dos.feature
239
254
  spec/cucumber/treetop_parser/with_comments.feature
255
+ spec/cucumber/world/pending_spec.rb
240
256
  spec/spec.opts
241
257
  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
+ Please see the "wiki":http://github.com/aslakhellesoy/cucumber/wikis/home
4
+ for documentation.
@@ -3,4 +3,4 @@
3
3
  $:.unshift(File.dirname(__FILE__ + '.rb') + '/../lib') unless $:.include?(File.dirname(__FILE__ + '.rb') + '/../lib')
4
4
 
5
5
  require 'cucumber/cli'
6
- Cucumber::CLI.execute
6
+ Cucumber::CLI.execute(ARGV)
@@ -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,6 +1,6 @@
1
- $KCODE='u'
2
1
  require 'spec'
3
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
4
4
  require 'calculator'
5
5
 
6
6
  Before do
@@ -1,5 +1,6 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
3
4
  require 'kalkulator'
4
5
 
5
6
  Before do
@@ -1,5 +1,6 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
3
4
  require 'calculator'
4
5
 
5
6
  Before do
@@ -1,5 +1,6 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
3
4
  require 'calculator'
4
5
 
5
6
  Before do
@@ -1,5 +1,6 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
3
4
  require 'calculador'
4
5
 
5
6
  Before do
@@ -1,5 +1,6 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
3
4
  require 'kalkulaator'
4
5
 
5
6
  Before do
@@ -1,13 +1,15 @@
1
- Fonction: Addition
2
- Afin d'eviter des conneries
3
- Etant un comptable
4
- Je désire additionner deux chiffres
1
+ Fonctionnalité: Addition
2
+ Afin de financer mon bonus avec l'argent des pigeons
3
+ En tant que trader
4
+ Je souhaite pouvoir additionner 2 chiffres
5
5
 
6
- Scenario: 7 et 5
7
- Soit que j'ai entré 5
8
- Et que j'ai entré 7
9
-
10
- Scenario: Additionner
11
- SoitScenario: 7 et 5
6
+ Scénario: Addition de produits dérivés
7
+ Etant donné que je tape 2
8
+ Et que je tape 1
12
9
  Lorsque je tape additionner
13
- Alors le reultat doit être 12
10
+ Alors le résultat doit être 3
11
+
12
+ Plus d'exemples:
13
+ | a | b | sum |
14
+ | 2 | 2 | 4 |
15
+ | 2 | 3 | 5 |
@@ -1,5 +1,6 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
3
4
  require 'calculatrice'
4
5
 
5
6
  Before do
@@ -9,14 +10,17 @@ end
9
10
  After do
10
11
  end
11
12
 
12
- Given /que j'ai entré (\d+)/ do |n|
13
+ # Etant donné que je tape ...
14
+ Given /que je tape (\d+)/ do |n|
13
15
  @calc.push n.to_i
14
16
  end
15
17
 
18
+ # Lorsque je tape additionner
16
19
  When 'je tape additionner' do
17
20
  @result = @calc.additionner
18
21
  end
19
22
 
20
- Then /le reultat doit être (\d*)/ do |result|
23
+ # Alors le résultat doit être ...
24
+ Then /le résultat doit être (\d*)/ do |result|
21
25
  @result.should == result.to_i
22
26
  end
@@ -1,5 +1,6 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
3
4
  require 'calculator'
4
5
 
5
6
  Before do
@@ -1,5 +1,6 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
3
4
  require 'calcolatrice'
4
5
 
5
6
  Before do
@@ -1,5 +1,7 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
4
+ $KCODE = 'e'
3
5
  require 'calculator'
4
6
 
5
7
  Before do
@@ -1,5 +1,6 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
3
4
  require 'calculator'
4
5
 
5
6
  Before do
@@ -1,5 +1,6 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
3
4
  require 'kalkulator'
4
5
 
5
6
  Before do
@@ -1,5 +1,6 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
3
4
  require 'calculadora'
4
5
 
5
6
  Before do
@@ -1,5 +1,6 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
3
4
  require 'calculator'
4
5
 
5
6
  Before do
@@ -1,5 +1,6 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
3
4
  require 'kalkulator'
4
5
 
5
6
  Before do
@@ -1,5 +1,6 @@
1
1
  require 'spec'
2
2
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ require 'cucumber/formatters/unicode'
3
4
  require 'calculator'
4
5
 
5
6
  Before do
@@ -6,4 +6,4 @@ Feature: Search
6
6
  Scenario: Find what I'm looking for
7
7
  Given I am on the Google search page
8
8
  When I search for "rspec"
9
- Then I should see a link to "RSpec-1.1.4: Overview":http://rspec.info/
9
+ Then I should see a link to http://rspec.info/
@@ -35,7 +35,6 @@ When /I search for "(.*)"/ do |query|
35
35
  @page.search(query)
36
36
  end
37
37
 
38
- Then /I should see a link to "(.*)":(.*)/ do |text, expected_url|
39
- observed_url = @browser.get_attribute("link=#{text}@href")
40
- observed_url.should == expected_url
38
+ Then /I should see a link to (.*)/ do |expected_url|
39
+ @browser.is_element_present("css=a[href='#{expected_url}']").should be_true
41
40
  end
@@ -0,0 +1,18 @@
1
+ class EattingMachine
2
+
3
+ attr_reader :fruit_total, :belly_count
4
+ attr_accessor :belly_count
5
+
6
+ def initialize(fruit_name, fruit_total)
7
+ @fruit_name = fruit_name
8
+ @fruit_total = fruit_total.to_i
9
+ @belly_count = 0
10
+ end
11
+
12
+ def eat(count)
13
+ count = count.to_i
14
+ @fruit_total = @fruit_total - count
15
+ @belly_count += count
16
+ end
17
+
18
+ end
@@ -0,0 +1,20 @@
1
+ class Pantry
2
+
3
+ def initialize
4
+ @items = {}
5
+ end
6
+
7
+ def add(food_name, count)
8
+ @items[food_name] ||= 0
9
+ @items[food_name] += count.to_i
10
+ end
11
+
12
+ def remove(food_name, count)
13
+ @items[food_name] -= count.to_i
14
+ end
15
+
16
+ def count(food_name)
17
+ @items[food_name]
18
+ end
19
+
20
+ end
@@ -0,0 +1,64 @@
1
+ Feature: Outlines
2
+ In order to re-use scenario table values
3
+ As a citizen of Cucumbia
4
+ I want to explicitly mark the parameters in a scenario outline
5
+
6
+ Scenario Outline: controlling order
7
+ Given there are <start> cucumbers
8
+ When I eat <eat> cucumbers
9
+ Then I should have <left> cucumbers
10
+
11
+ Examples:
12
+ | left | start | eat |
13
+ | 7 | 12 | 5 |
14
+ | 15 | 20 | 5 |
15
+
16
+ Scenario Outline: reusing place holder
17
+ Given there are <start> cucumbers
18
+ When I eat <eat> cucumbers
19
+ Then I should have <left> cucumbers
20
+ And I should have <eat> cucumbers in my belly
21
+
22
+ Examples:
23
+ | start | eat | left |
24
+ | 12 | 5 | 7 |
25
+ | 20 | 5 | 15 |
26
+
27
+ Scenario Outline: no placeholders
28
+ Given there are 12 cucumbers
29
+ When I eat 5 cucumbers
30
+ Then I should have 7 cucumbers
31
+
32
+ Examples:
33
+ | start | eat | left |
34
+ | 12 | 5 | 7 |
35
+ | 20 | 5 | 15 |
36
+
37
+ Scenario Outline: using '<' and '>' not as placeholder
38
+ Given the belly space is < 12 and > 6
39
+ And there are <start> cucumbers
40
+ When I eat <eat> cucumbers
41
+ Then I should have <left> cucumbers
42
+
43
+ Examples:
44
+ | start | eat | left |
45
+ | 12 | 5 | 7 |
46
+ | 20 | 5 | 15 |
47
+
48
+ Scenario Outline: with step tables
49
+ Given I have the following fruits in my pantry
50
+ | name | quantity |
51
+ | cucumbers | 10 |
52
+ | strawberrys | 5 |
53
+ | apricots | 7 |
54
+
55
+ When I eat <number> <fruits> from the pantry
56
+ Then I should have <left> <fruits> in the pantry
57
+
58
+ Examples:
59
+ | number | fruits | left |
60
+ | 2 | cucumbers | 8 |
61
+ | 4 | strawberrys| 1 |
62
+ | 2 | apricots | 5 |
63
+
64
+