kosmas58-cucumber 0.2.2.1 → 0.2.3.3

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 (101) hide show
  1. data/History.txt +57 -5
  2. data/Manifest.txt +21 -4
  3. data/bin/cucumber +1 -1
  4. data/config/hoe.rb +2 -2
  5. data/examples/i18n/Rakefile +6 -8
  6. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -1
  7. data/examples/i18n/ar/lib/calculator.rb +1 -0
  8. data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +1 -1
  9. data/examples/i18n/de/features/step_definitons/calculator_steps.rb +1 -1
  10. data/examples/i18n/en/features/step_definitons/calculator_steps.rb +1 -1
  11. data/examples/i18n/es/features/step_definitons/calculador_steps.rb +1 -1
  12. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +1 -1
  13. data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +1 -1
  14. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +1 -1
  15. data/examples/i18n/id/features/step_definitons/calculator_steps.rb +1 -1
  16. data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +1 -1
  17. data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +1 -1
  18. data/examples/i18n/ko/features/addition.feature +1 -1
  19. data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +1 -1
  20. data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +1 -1
  21. data/examples/i18n/no/features/support/env.rb +1 -1
  22. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +1 -1
  23. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +1 -1
  24. data/examples/i18n/ru/features/support/env.rb +1 -1
  25. data/examples/i18n/ru/features/support/world.rb +4 -3
  26. data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +1 -1
  27. data/examples/i18n/sk/Rakefile +6 -0
  28. data/examples/i18n/sk/features/addition.feature +16 -0
  29. data/examples/i18n/sk/features/division.feature +9 -0
  30. data/examples/i18n/sk/features/step_definitons/calculator_steps.rb +24 -0
  31. data/examples/i18n/sk/lib/calculator.rb +14 -0
  32. data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +1 -1
  33. data/examples/i18n/zh-TW/features/step_definitons/calculator_steps.rb +1 -1
  34. data/examples/self_test/features/background/background_with_name.feature +7 -0
  35. data/examples/self_test/features/step_definitions/sample_steps.rb +8 -2
  36. data/examples/self_test/features/undefined_multiline_args.feature +12 -0
  37. data/examples/sinatra/features/support/env.rb +2 -6
  38. data/examples/test_unit/features/step_definitions/test_unit_steps.rb +1 -4
  39. data/examples/tickets/Rakefile +1 -1
  40. data/examples/tickets/features/246.feature +4 -0
  41. data/examples/tickets/features/270/back.feature +14 -0
  42. data/examples/tickets/features/270/back.steps.rb +14 -0
  43. data/examples/tickets/features/step_definitons/246_steps.rb +3 -0
  44. data/features/background.feature +21 -4
  45. data/features/cucumber_cli.feature +18 -5
  46. data/features/cucumber_cli_outlines.feature +5 -2
  47. data/features/snippet.feature +23 -0
  48. data/features/step_definitions/cucumber_steps.rb +6 -2
  49. data/features/usage.feature +5 -0
  50. data/gem_tasks/rspec.rake +3 -2
  51. data/lib/cucumber/ast/background.rb +3 -3
  52. data/lib/cucumber/ast/examples.rb +0 -12
  53. data/lib/cucumber/ast/feature.rb +2 -12
  54. data/lib/cucumber/ast/feature_element.rb +0 -8
  55. data/lib/cucumber/ast/features.rb +1 -1
  56. data/lib/cucumber/ast/outline_table.rb +14 -22
  57. data/lib/cucumber/ast/py_string.rb +6 -11
  58. data/lib/cucumber/ast/scenario.rb +1 -8
  59. data/lib/cucumber/ast/scenario_outline.rb +1 -11
  60. data/lib/cucumber/ast/step.rb +3 -9
  61. data/lib/cucumber/ast/step_collection.rb +0 -4
  62. data/lib/cucumber/ast/step_invocation.rb +5 -6
  63. data/lib/cucumber/ast/table.rb +26 -22
  64. data/lib/cucumber/ast/tags.rb +0 -8
  65. data/lib/cucumber/ast/visitor.rb +12 -25
  66. data/lib/cucumber/cli/configuration.rb +2 -2
  67. data/lib/cucumber/cli/main.rb +5 -2
  68. data/lib/cucumber/core_ext/instance_exec.rb +17 -4
  69. data/lib/cucumber/formatter/ansicolor.rb +10 -2
  70. data/lib/cucumber/formatter/console.rb +2 -1
  71. data/lib/cucumber/formatter/html.rb +21 -7
  72. data/lib/cucumber/formatter/pretty.rb +27 -20
  73. data/lib/cucumber/formatter/usage.rb +16 -0
  74. data/lib/cucumber/languages.yml +68 -7
  75. data/lib/cucumber/parser/feature.rb +238 -135
  76. data/lib/cucumber/parser/feature.tt +117 -22
  77. data/lib/cucumber/parser/i18n.tt +4 -0
  78. data/lib/cucumber/parser/table.rb +37 -25
  79. data/lib/cucumber/parser/table.tt +15 -3
  80. data/lib/cucumber/parser/treetop_ext.rb +48 -9
  81. data/lib/cucumber/parser.rb +2 -7
  82. data/lib/cucumber/step_definition.rb +13 -14
  83. data/lib/cucumber/step_mother.rb +93 -11
  84. data/lib/cucumber/version.rb +2 -2
  85. data/rails_generators/cucumber/templates/env.rb +1 -1
  86. data/rails_generators/cucumber/templates/paths.rb +15 -5
  87. data/rails_generators/cucumber/templates/webrat_steps.rb +8 -0
  88. data/spec/cucumber/ast/background_spec.rb +1 -0
  89. data/spec/cucumber/ast/feature_factory.rb +1 -1
  90. data/spec/cucumber/ast/feature_spec.rb +2 -2
  91. data/spec/cucumber/ast/scenario_spec.rb +0 -27
  92. data/spec/cucumber/ast/table_spec.rb +23 -2
  93. data/spec/cucumber/core_ext/proc_spec.rb +25 -8
  94. data/spec/cucumber/parser/feature_parser_spec.rb +43 -41
  95. data/spec/cucumber/step_definition_spec.rb +8 -0
  96. data/spec/cucumber/step_mother_spec.rb +48 -0
  97. data/spec/spec_helper.rb +2 -11
  98. metadata +17 -6
  99. data/examples/tickets/cucumber.yml +0 -3
  100. data/lib/cucumber/parser/basic.rb +0 -0
  101. data/spec/cucumber/ast/tags_spec.rb +0 -19
data/History.txt CHANGED
@@ -1,10 +1,62 @@
1
- == 0.2.3 (In Git)
1
+ == 0.3.0 (In Git)
2
+
3
+ This release has some minor changes to the APIs, but big enough that a new major release is in order.
4
+ The biggest change is the new semantics of the #World method. Previously you would call this method
5
+ several times, passing a Proc and extending the world object of the previous one with a Ruby module.
6
+ The problem was that there was no nice way to ensure the order in which these procs were called, which
7
+ led to some unexpected situations. In this release you can only register a single World proc. If you
8
+ want to extend a world with certain modules, you simply call the #World method with the module(s)
9
+ you wish to extend the World with. The Sinatra example illustrates how to do this. Also check out
10
+ the RDoc for Cucumber::StepMother#World.
11
+
12
+ The Visitor API (which is used for formatters) has also changed slightly. However, we have tried to
13
+ do this in a backwards compatible way, so if you have custom formatters for Cucumber 0.2 they should
14
+ still work.
2
15
 
3
16
  === New features
17
+ * Added translation for Bulgarian (Krasimir Angelov)
18
+ * Updated translation for Polish (#273 Grzegorz Marszałek)
19
+ * Only a single World proc can be registered. World extension now happens by calling #World with ruby modules.
20
+ * Portuguese uses Funcionalidade in stead of Característica and accented words are aliased with unaccented ones (Alexandre da Silva and Felipe Coury).
21
+ * The usage formatter also prints unused step definitions (Aslak Hellesøy)
22
+ * Better exception if a World proc returns nil. (Aslak Hellesøy)
23
+ * Allow Step Definitions to use |*varargs|, but only on Ruby 1.9. (Aslak Hellesøy)
24
+ * Snippets for steps that use Step Tables or PyStrings include block param and object type hint comment (#247 Joseph Wilk)
25
+ * Support description string for Backgrounds (#271 Joseph Wilk)
26
+
27
+ === Bugfixes
28
+ * Fixed --format html leads to an error (#252 Aslak Hellesøy)
29
+ * Fixed Background runs twice (#255 Aslak Hellesøy)
30
+ * Fixed Background Transactions and :xx (#270 Aslak Hellesøy)
31
+ * Fixed Autospec failing with cucumber 0.2 (#254 Aslak Hellesøy)
32
+ * Sibling file detecting not working (#278 Aslak Hellesøy)
33
+
34
+ === Removed/changed features
35
+ * The visitor API has changed slightly:
36
+ ** #visit_step_name, #visit_multiline_arg and #visit_exception are no longer official API methods.
37
+ ** #visit_step_result replaces those 3 methods.
38
+ ** Table and PyString no longer hold status information. Each visitor subclass should store state in @state if needed.
39
+ ** #visit_py_string no longer takes a status argument.
40
+
41
+ == 0.2.3 2009-03-30
42
+
43
+ This release sports 4 updated languages, slightly better help with snippets if you "quote" arguments
44
+ in your steps. Windows/JRuby users can enjoy colours and you get some more sugar with Tables.
45
+
46
+ === New features
47
+ * Added new Then /^I should be on (.+)$/ do |page_name| step (Grant Hollingworth)
48
+ * Use skipped_param color for examples table header (#266 Eugene Naydanov)
49
+ * Added new Cucumber::Ast::Table#rows_hash method (Torbjørn Vatn)
50
+ * Windows/JRuby users can now enjoy colourful output (via http://github.com/aslakhellesoy/ansicolor) (#166 Aslak Hellesøy)
4
51
  * Ambiguous step errors hint about --guess (unless --guess already on) (Aslak Hellesøy)
5
- * Updated language for Dutch (Bart Zonneveld)
6
- * Updated language for Italian (Alessandro Baroni)
7
- * Updated language for Japanese (KAKUTANI Shintaro)
52
+ * Added translation for Slovak (Ahmed Al Hafoudh)
53
+ * Updated translation for Dutch (Bart Zonneveld)
54
+ * Updated translation for Italian (Alessandro Baroni)
55
+ * Updated translation for Japanese (KAKUTANI Shintaro)
56
+
57
+ === Bugfixes
58
+ * Fixed step name after step keyword without space (#265 Aslak Hellesøy)
59
+ * Backtrace is back in HTML reports (Aslak Hellesøy)
8
60
 
9
61
  == 0.2.2 2009-03-25
10
62
 
@@ -73,7 +125,7 @@ for multiline arguments are some of the highlights.
73
125
  * Can't use an empty string as a table value in a scenario outline (#172 Aslak Hellesøy)
74
126
  * Really skip skipped steps (#90 Aslak Hellesøy)
75
127
  * No output for multi-line strings (#71 Aslak Hellesøy)
76
- * Fix cucumber/formatters/unicode flaws on Windows (#145 Michael)
128
+ * Fix cucumber/formatter/unicode flaws on Windows (#145 Michael)
77
129
  * Autotest-related Bugs: YAML missing (#136 Tobias Pape)
78
130
  * Overeager "rescue LoadError" hides lots of errors (#137 Jonathan del Strother)
79
131
  * Nested steps don't show mismatch (#116 Aslak Hellesøy)
data/Manifest.txt CHANGED
@@ -21,6 +21,14 @@ examples/i18n/ar/Rakefile
21
21
  examples/i18n/ar/features/addition.feature
22
22
  examples/i18n/ar/features/step_definitons/calculator_steps.rb
23
23
  examples/i18n/ar/lib/calculator.rb
24
+ examples/i18n/bg/Rakefile
25
+ examples/i18n/bg/features/addition.feature
26
+ examples/i18n/bg/features/consecutive_calculations.feature
27
+ examples/i18n/bg/features/division.feature
28
+ examples/i18n/bg/features/step_definitons/calculator_steps.rb
29
+ examples/i18n/bg/features/support/env.rb
30
+ examples/i18n/bg/features/support/world.rb
31
+ examples/i18n/bg/lib/calculator.rb
24
32
  examples/i18n/da/Rakefile
25
33
  examples/i18n/da/features/step_definitons/kalkulator_steps.rb
26
34
  examples/i18n/da/features/summering.feature
@@ -108,6 +116,11 @@ examples/i18n/se/Rakefile
108
116
  examples/i18n/se/features/step_definitons/kalkulator_steps.rb
109
117
  examples/i18n/se/features/summering.feature
110
118
  examples/i18n/se/lib/kalkulator.rb
119
+ examples/i18n/sk/Rakefile
120
+ examples/i18n/sk/features/addition.feature
121
+ examples/i18n/sk/features/division.feature
122
+ examples/i18n/sk/features/step_definitons/calculator_steps.rb
123
+ examples/i18n/sk/lib/calculator.rb
111
124
  examples/i18n/zh-CN/Rakefile
112
125
  examples/i18n/zh-CN/features/addition.feature
113
126
  examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
@@ -135,6 +148,7 @@ examples/selenium_webrat/features/step_definitons/search_steps.rb
135
148
  examples/selenium_webrat/features/support/env.rb
136
149
  examples/self_test/README.textile
137
150
  examples/self_test/Rakefile
151
+ examples/self_test/features/background/background_with_name.feature
138
152
  examples/self_test/features/background/failing_background.feature
139
153
  examples/self_test/features/background/failing_background_after_success.feature
140
154
  examples/self_test/features/background/multiline_args_background.feature
@@ -151,6 +165,7 @@ examples/self_test/features/step_definitions/sample_steps.rb
151
165
  examples/self_test/features/support/env.rb
152
166
  examples/self_test/features/support/tag_count_formatter.rb
153
167
  examples/self_test/features/tons_of_cukes.feature
168
+ examples/self_test/features/undefined_multiline_args.feature
154
169
  examples/sinatra/Rakefile
155
170
  examples/sinatra/app.rb
156
171
  examples/sinatra/features/add.feature
@@ -162,7 +177,6 @@ examples/test_unit/Rakefile
162
177
  examples/test_unit/features/step_definitions/test_unit_steps.rb
163
178
  examples/test_unit/features/test_unit.feature
164
179
  examples/tickets/Rakefile
165
- examples/tickets/cucumber.yml
166
180
  examples/tickets/features/172.feature
167
181
  examples/tickets/features/177/1.feature
168
182
  examples/tickets/features/177/2.feature
@@ -170,10 +184,14 @@ examples/tickets/features/177/3.feature
170
184
  examples/tickets/features/180.feature
171
185
  examples/tickets/features/236.feature
172
186
  examples/tickets/features/241.feature
187
+ examples/tickets/features/246.feature
173
188
  examples/tickets/features/248.feature
189
+ examples/tickets/features/270/back.feature
190
+ examples/tickets/features/270/back.steps.rb
174
191
  examples/tickets/features/lib/eatting_machine.rb
175
192
  examples/tickets/features/lib/pantry.rb
176
193
  examples/tickets/features/scenario_outline.feature
194
+ examples/tickets/features/step_definitons/246_steps.rb
177
195
  examples/tickets/features/step_definitons/248_steps.rb
178
196
  examples/tickets/features/step_definitons/scenario_outline_steps.rb
179
197
  examples/tickets/features/step_definitons/tickets_steps.rb
@@ -189,6 +207,7 @@ features/cucumber_cli_diff_disabled.feature
189
207
  features/cucumber_cli_outlines.feature
190
208
  features/custom_formatter.feature
191
209
  features/report_called_undefined_steps.feature
210
+ features/snippet.feature
192
211
  features/step_definitions/cucumber_steps.rb
193
212
  features/step_definitions/extra_steps.rb
194
213
  features/support/env.rb
@@ -249,7 +268,6 @@ lib/cucumber/formatter/usage.rb
249
268
  lib/cucumber/formatters/unicode.rb
250
269
  lib/cucumber/languages.yml
251
270
  lib/cucumber/parser.rb
252
- lib/cucumber/parser/basic.rb
253
271
  lib/cucumber/parser/feature.rb
254
272
  lib/cucumber/parser/feature.tt
255
273
  lib/cucumber/parser/i18n.tt
@@ -289,7 +307,6 @@ spec/cucumber/ast/scenario_spec.rb
289
307
  spec/cucumber/ast/step_collection_spec.rb
290
308
  spec/cucumber/ast/step_spec.rb
291
309
  spec/cucumber/ast/table_spec.rb
292
- spec/cucumber/ast/tags_spec.rb
293
310
  spec/cucumber/broadcaster_spec.rb
294
311
  spec/cucumber/cli/configuration_spec.rb
295
312
  spec/cucumber/cli/main_spec.rb
@@ -326,4 +343,4 @@ spec/cucumber/treetop_parser/with_comments.feature
326
343
  spec/cucumber/treetop_parser/with_tags.feature
327
344
  spec/cucumber/world/pending_spec.rb
328
345
  spec/spec.opts
329
- spec/spec_helper.rb
346
+ spec/spec_helper.rb
data/bin/cucumber CHANGED
@@ -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/main'
6
- Cucumber::Cli::Main.execute(ARGV.dup)
6
+ Cucumber::Cli::Main.execute(ARGV.dup) # The dup is to keep ARGV intact, so that tools like ruby-debug can respawn.
data/config/hoe.rb CHANGED
@@ -60,8 +60,8 @@ $hoe = Hoe.new(GEM_NAME, VERS) do |p|
60
60
  #p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
61
61
  p.extra_deps = [
62
62
  ['term-ansicolor', '>= 1.0.3'],
63
- ['treetop', '>= 1.2.4'],
64
- ['polyglot', '>= 0.2.4'], # Remove this when Treetop no longer loads polyglot by default.
63
+ ['treetop', '>= 1.2.5'],
64
+ ['polyglot', '>= 0.2.5'], # Remove this when Treetop no longer loads polyglot by default.
65
65
  ['diff-lcs', '>= 1.1.2'],
66
66
  ['builder', '>= 2.1.2']
67
67
  ]
@@ -4,14 +4,16 @@ 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
- if supported?(lang)
7
+ if examples_working?(lang)
8
8
  Dir.chdir(f) do
9
9
  rake("features")
10
10
  end
11
11
  else
12
12
  STDERR.puts %{
13
13
  !!!!!
14
- !!!!! SKIPPING #{lang} (Still needs some work)
14
+ !!!!!
15
+ !!!!! SKIPPING #{lang} (The examples are out of date - please help update them)
16
+ !!!!!
15
17
  !!!!!
16
18
  }
17
19
  end
@@ -19,12 +21,8 @@ task :i18n do
19
21
  end
20
22
  end
21
23
 
22
- def supported?(lang)
23
- if RUBY_VERSION =~ /^1\.9/
24
- !%w{ar ko zh-CN}.index(lang)
25
- else
26
- !%w{ar ko}.index(lang)
27
- end
24
+ def examples_working?(lang)
25
+ !%w{ro ko li lt}.index(lang)
28
26
  end
29
27
 
30
28
  def rake(args)
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calculator'
6
6
 
7
7
  Before do
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  class Calculator
2
3
  def push(n)
3
4
  @args ||= []
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'kalkulator'
6
6
 
7
7
  Before do
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calculator'
6
6
 
7
7
  Before do
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calculator'
6
6
 
7
7
  Before do
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calculador'
6
6
 
7
7
  Before do
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'kalkulaator'
6
6
 
7
7
  Before do
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'laskin'
6
6
 
7
7
  Before do
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calculatrice'
6
6
 
7
7
  Soit /^une calculatrice$/ do
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calculator'
6
6
 
7
7
  Before do
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calcolatrice'
6
6
 
7
7
  Before do
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calculator'
6
6
 
7
7
  Before do
@@ -9,7 +9,7 @@
9
9
  만일 내가 add를 누르면
10
10
  그러면 화면에 출력된 결과는 120이다
11
11
 
12
- 다른 예:
12
+ 예:
13
13
  | 입력1 | 입력2 | 버튼 | 결과 |
14
14
  | 20 | 30 | add | 50 |
15
15
  | 2 | 5 | add | 7 |
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calculator'
6
6
 
7
7
  Before do
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calculator'
6
6
 
7
7
  Before do
@@ -2,5 +2,5 @@
2
2
  $KCODE='u' unless Cucumber::RUBY_1_9
3
3
  require 'spec/expectations'
4
4
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
5
- require 'cucumber/formatters/unicode'
5
+ require 'cucumber/formatter/unicode'
6
6
  require 'kalkulator'
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calculadora'
6
6
 
7
7
  Before do
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calculator'
6
6
 
7
7
  Before do
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calculator'
6
6
  $KCODE='u' unless Cucumber::RUBY_1_9
@@ -1,7 +1,8 @@
1
1
  # encoding: utf-8
2
-
3
- World do
2
+ module LazyCalc
4
3
  def calc
5
4
  @calc ||= Calculator.new
6
5
  end
7
- end
6
+ end
7
+
8
+ World(LazyCalc)
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'kalkulator'
6
6
 
7
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 sk"
6
+ end
@@ -0,0 +1,16 @@
1
+ Požiadavka: Sčítavanie
2
+ Aby som sa vyhol hlúpym chybám
3
+ Ako matematický idiot
4
+ Chcem vedieť ako sa sčítavajú dve čísla
5
+
6
+ Náčrt Scenáru: Sčítanie dvoch čísel
7
+ Pokiaľ Zadám číslo <vstup_1> do kalkulačky
8
+ A Zadám číslo <vstup_2> do kalkulačky
9
+ Keď Stlačím tlačidlo <tlačidlo>
10
+ Tak Výsledok by mal byť <výstup>
11
+
12
+ Príklady:
13
+ | vstup_1 | vstup_2 | tlačidlo | výstup |
14
+ | 20 | 30 | add | 50 |
15
+ | 2 | 5 | add | 7 |
16
+ | 0 | 40 | add | 40 |
@@ -0,0 +1,9 @@
1
+ Požiadavka: Delenie
2
+ Aby som sa vyhol hlúpym chybám
3
+ Pokladníci musia vedieť vypočítať podiel
4
+
5
+ Scenár: Prirodzené čísla
6
+ Pokiaľ Zadám číslo 3 do kalkulačky
7
+ A Zadám číslo 2 do kalkulačky
8
+ Keď Stlačím tlačidlo divide
9
+ Tak Výsledok by mal byť 1.5
@@ -0,0 +1,24 @@
1
+ # encoding: utf-8
2
+ require 'spec/expectations'
3
+ $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
+ require 'cucumber/formatter/unicode'
5
+ require 'calculator'
6
+
7
+ Before do
8
+ @calc = Calculator.new
9
+ end
10
+
11
+ After do
12
+ end
13
+
14
+ Given /Zadám číslo (\d+) do kalkulačky/ do |n|
15
+ @calc.push n.to_i
16
+ end
17
+
18
+ When /Stlačím tlačidlo (\w+)/ do |op|
19
+ @result = @calc.send op
20
+ end
21
+
22
+ Then /Výsledok by mal byť (.*)/ do |result|
23
+ @result.should == result.to_f
24
+ end
@@ -0,0 +1,14 @@
1
+ class Calculator
2
+ def push(n)
3
+ @args ||= []
4
+ @args << n
5
+ end
6
+
7
+ def add
8
+ @args.inject(0){|n,sum| sum+=n}
9
+ end
10
+
11
+ def divide
12
+ @args[0].to_f / @args[1].to_f
13
+ end
14
+ end
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calculator'
6
6
 
7
7
  Before do
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec/expectations'
3
3
  $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
4
- require 'cucumber/formatters/unicode'
4
+ require 'cucumber/formatter/unicode'
5
5
  require 'calculator'
6
6
 
7
7
  Before do
@@ -0,0 +1,7 @@
1
+ Feature: background with name
2
+
3
+ Background: I'm a background and I'm ok
4
+ Given '10' cukes
5
+
6
+ Scenario: example
7
+ Then I should have '10' cukes
@@ -25,9 +25,9 @@ Given /^call step "(.*)"$/ do |step|
25
25
  end
26
26
 
27
27
  Given /^'(.+)' cukes$/ do |cukes|
28
+ raise "We already have #{@cukes} cukes!" if @cukes
28
29
  @cukes = cukes
29
30
  end
30
-
31
31
  Then /^I should have '(.+)' cukes$/ do |cukes|
32
32
  @cukes.should == cukes
33
33
  end
@@ -52,7 +52,7 @@ Given /^multiline string$/ do |string|
52
52
  end
53
53
 
54
54
  Then /^the table should be$/ do |table|
55
- @table.to_sexp.should == table.to_sexp
55
+ @table.raw.should == table.raw
56
56
  end
57
57
 
58
58
  Then /^the multiline string should be$/ do |string|
@@ -62,3 +62,9 @@ end
62
62
  Given /^failing expectation$/ do
63
63
  'this'.should == 'that'
64
64
  end
65
+
66
+ Given /^unused$/ do
67
+ end
68
+
69
+ Given /^another unused$/ do
70
+ end
@@ -0,0 +1,12 @@
1
+ Feature: undefined multiline args
2
+
3
+ Scenario: pystring
4
+ Given a pystring
5
+ """
6
+ example
7
+ """
8
+
9
+ Scenario: table
10
+ Given a table
11
+ | table |
12
+ |example|
@@ -16,9 +16,5 @@ Webrat.configure do |config|
16
16
  config.mode = :sinatra
17
17
  end
18
18
 
19
- World do
20
- session = Webrat::SinatraSession.new
21
- session.extend(Webrat::Matchers)
22
- session.extend(Webrat::HaveTagMatcher)
23
- session
24
- end
19
+ World{Webrat::SinatraSession.new}
20
+ World(Webrat::Matchers, Webrat::HaveTagMatcher)
@@ -1,8 +1,5 @@
1
1
  require 'test/unit/assertions'
2
- World do |o|
3
- o.extend(Test::Unit::Assertions)
4
- o
5
- end
2
+ World(Test::Unit::Assertions)
6
3
 
7
4
  Given /^(\w+) = (\w+)$/ do |var, value|
8
5
  instance_variable_set("@#{var}", value)
@@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__) + '/../../lib')
2
2
  require 'cucumber/rake/task'
3
3
 
4
4
  Cucumber::Rake::Task.new(:pretty) do |t|
5
- t.cucumber_opts = "--format pretty"
5
+ t.cucumber_opts = "--format pretty -q"
6
6
  end
7
7
 
8
8
  Cucumber::Rake::Task.new(:html) do |t|
@@ -0,0 +1,4 @@
1
+ Feature: https://rspec.lighthouseapp.com/projects/16211/tickets/246-distorted-console-output-for-slightly-complicated-step-regexp-match
2
+
3
+ Scenario: See "No Record(s) Found" for Zero Existing
4
+ Given no public holiday exists in the system
@@ -0,0 +1,14 @@
1
+ Feature: Background
2
+ In for background to work properly
3
+ As a user
4
+ I want it to run transactionally and only once when I call an individual scenario
5
+
6
+ Background:
7
+ Given plop
8
+
9
+ Scenario: Barping
10
+ When I barp
11
+
12
+
13
+ Scenario: Wibbling
14
+ When I wibble