kosmas58-cucumber 0.2.3.3 → 0.3.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (210) hide show
  1. data/History.txt +203 -3
  2. data/Manifest.txt +0 -346
  3. data/README.txt +0 -21
  4. data/Rakefile +3 -1
  5. data/bin/cucumber +12 -1
  6. data/config/hoe.rb +6 -5
  7. data/cucumber.yml +3 -1
  8. data/examples/cs/Rakefile +1 -1
  9. data/examples/cs/features/addition.feature +5 -5
  10. data/examples/cs/features/step_definitons/calculator_steps.rb +2 -2
  11. data/examples/dos_line_endings/Rakefile +1 -1
  12. data/examples/dos_line_endings/features/dos_line_endings.feature +9 -9
  13. data/examples/i18n/Rakefile +1 -1
  14. data/examples/i18n/ar/Rakefile +1 -1
  15. data/examples/i18n/bg/Rakefile +6 -0
  16. data/examples/i18n/bg/features/addition.feature +11 -0
  17. data/examples/i18n/bg/features/consecutive_calculations.feature +18 -0
  18. data/examples/i18n/bg/features/division.feature +16 -0
  19. data/examples/i18n/bg/features/step_definitons/calculator_steps.rb +24 -0
  20. data/examples/i18n/bg/features/support/env.rb +6 -0
  21. data/examples/i18n/bg/features/support/world.rb +8 -0
  22. data/examples/i18n/bg/lib/calculator.rb +24 -0
  23. data/examples/i18n/cat/Rakefile +6 -0
  24. data/examples/i18n/cat/features/step_definitons/calculator_steps.rb +21 -0
  25. data/examples/i18n/cat/features/suma.feature +16 -0
  26. data/examples/i18n/cat/lib/calculadora.rb +16 -0
  27. data/examples/i18n/da/Rakefile +1 -1
  28. data/examples/i18n/de/Rakefile +1 -1
  29. data/examples/i18n/en/Rakefile +1 -1
  30. data/examples/i18n/en-lol/Rakefile +1 -1
  31. data/examples/i18n/es/Rakefile +1 -1
  32. data/examples/i18n/et/Rakefile +1 -1
  33. data/examples/i18n/fi/Rakefile +1 -1
  34. data/examples/i18n/fr/Rakefile +1 -1
  35. data/examples/i18n/fr/features/addition.feature +4 -4
  36. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +1 -1
  37. data/examples/i18n/fr/lib/calculatrice.rb +1 -1
  38. data/examples/i18n/he/Rakefile +6 -0
  39. data/examples/i18n/he/features/addition.feature +16 -0
  40. data/examples/i18n/he/features/division.feature +9 -0
  41. data/examples/i18n/he/features/step_definitons/calculator_steps.rb +24 -0
  42. data/examples/i18n/he/lib/calculator.rb +14 -0
  43. data/examples/i18n/hu/Rakefile +6 -0
  44. data/examples/i18n/hu/features/addition.feature +16 -0
  45. data/examples/i18n/hu/features/division.feature +9 -0
  46. data/examples/i18n/hu/features/step_definitons/calculator_steps.rb +25 -0
  47. data/examples/i18n/hu/lib/calculator.rb +14 -0
  48. data/examples/i18n/id/Rakefile +1 -1
  49. data/examples/i18n/it/Rakefile +1 -1
  50. data/examples/i18n/ja/Rakefile +1 -1
  51. data/examples/i18n/ja/features/addition.feature +1 -1
  52. data/examples/i18n/ja/features/division.feature +1 -1
  53. data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +1 -1
  54. data/examples/i18n/ko/Rakefile +1 -1
  55. data/examples/i18n/lt/Rakefile +1 -1
  56. data/examples/i18n/lt/features/addition.feature +2 -3
  57. data/examples/i18n/lv/Rakefile +6 -0
  58. data/examples/i18n/lv/features/addition.feature +16 -0
  59. data/examples/i18n/lv/features/division.feature +9 -0
  60. data/examples/i18n/lv/features/step_definitons/calculator_steps.rb +24 -0
  61. data/examples/i18n/lv/lib/calculator.rb +14 -0
  62. data/examples/i18n/no/Rakefile +1 -1
  63. data/examples/i18n/pl/Rakefile +6 -0
  64. data/examples/i18n/pl/features/addition.feature +16 -0
  65. data/examples/i18n/pl/features/division.feature +9 -0
  66. data/examples/i18n/pl/features/step_definitons/calculator_steps.rb +24 -0
  67. data/examples/i18n/pl/features/support/env.rb +6 -0
  68. data/examples/i18n/pl/lib/calculator.rb +14 -0
  69. data/examples/i18n/pt/Rakefile +1 -1
  70. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +3 -7
  71. data/examples/i18n/pt/features/support/env.rb +6 -0
  72. data/examples/i18n/ro/Rakefile +1 -1
  73. data/examples/i18n/ru/Rakefile +1 -1
  74. data/examples/i18n/se/Rakefile +1 -1
  75. data/examples/i18n/sk/Rakefile +1 -1
  76. data/examples/i18n/zh-CN/Rakefile +1 -1
  77. data/examples/i18n/zh-TW/Rakefile +1 -1
  78. data/examples/java/README.textile +2 -6
  79. data/examples/java/build.xml +33 -0
  80. data/examples/java/features/step_definitons/hello_steps.rb +0 -2
  81. data/examples/junit/features/one_passing_one_failing.feature +8 -0
  82. data/examples/junit/features/pending.feature +5 -0
  83. data/examples/junit/features/step_definitions/steps.rb +11 -0
  84. data/examples/selenium/Rakefile +1 -1
  85. data/examples/selenium_webrat/Rakefile +1 -1
  86. data/examples/selenium_webrat/config.ru +0 -0
  87. data/examples/selenium_webrat/features/search.feature +1 -1
  88. data/examples/selenium_webrat/features/step_definitons/search_steps.rb +2 -2
  89. data/examples/selenium_webrat/features/support/env.rb +7 -3
  90. data/examples/self_test/features/background/background_tagged_before_on_outline.feature +12 -0
  91. data/examples/self_test/features/background/failing_background.feature +1 -0
  92. data/examples/self_test/features/background/passing_background.feature +2 -2
  93. data/examples/self_test/features/multiline_name.feature +27 -0
  94. data/examples/self_test/features/sample.feature +2 -0
  95. data/examples/self_test/features/search_sample.feature +32 -0
  96. data/examples/self_test/features/step_definitions/sample_steps.rb +11 -0
  97. data/examples/self_test/features/support/env.rb +17 -1
  98. data/examples/sinatra/Rakefile +1 -1
  99. data/examples/test_unit/Rakefile +1 -1
  100. data/examples/tickets/Rakefile +3 -3
  101. data/examples/tickets/features/229/tagged_hooks.feature +8 -0
  102. data/examples/tickets/features/229/tagged_hooks.rb +14 -0
  103. data/examples/tickets/features/236.feature +9 -9
  104. data/examples/tickets/features/272/hooks.feature +26 -0
  105. data/examples/tickets/features/272/hooks_steps.rb +53 -0
  106. data/examples/tickets/features/279/py_string_indent.feature +25 -0
  107. data/examples/tickets/features/279/py_string_indent.steps.rb +12 -0
  108. data/examples/tickets/features/279/wrong.feature_ +11 -0
  109. data/examples/tickets/features/301/filter_background_tagged_hooks.feature +6 -0
  110. data/examples/tickets/features/301/filter_background_tagged_hooks_steps.rb +12 -0
  111. data/examples/tickets/features/306/only_background.feature +4 -0
  112. data/examples/tickets/features/step_definitons/tickets_steps.rb +0 -7
  113. data/examples/watir/Rakefile +1 -1
  114. data/examples/watir/features/search.feature +4 -1
  115. data/examples/watir/features/step_definitons/search_steps.rb +2 -4
  116. data/features/after_block_exceptions.feature +99 -0
  117. data/features/after_step_block_exceptions.feature +101 -0
  118. data/features/background.feature +105 -38
  119. data/features/cucumber_cli.feature +201 -64
  120. data/features/cucumber_cli_diff_disabled.feature +6 -4
  121. data/features/cucumber_cli_outlines.feature +60 -35
  122. data/features/custom_formatter.feature +3 -3
  123. data/features/exclude_files.feature +20 -0
  124. data/features/expand.feature +48 -0
  125. data/features/html_formatter/a.html +1632 -0
  126. data/features/html_formatter.feature +7 -0
  127. data/features/junit_formatter.feature +62 -0
  128. data/features/multiline_names.feature +43 -0
  129. data/features/rake_task.feature +150 -0
  130. data/features/report_called_undefined_steps.feature +4 -3
  131. data/features/snippet.feature +2 -3
  132. data/features/step_definitions/cucumber_steps.rb +98 -15
  133. data/features/support/env.rb +78 -3
  134. data/features/usage.feature +32 -19
  135. data/features/work_in_progress.feature +148 -0
  136. data/gem_tasks/deployment.rake +1 -1
  137. data/gem_tasks/rspec.rake +9 -2
  138. data/lib/cucumber/ast/background.rb +19 -7
  139. data/lib/cucumber/ast/comment.rb +4 -0
  140. data/lib/cucumber/ast/feature.rb +7 -1
  141. data/lib/cucumber/ast/feature_element.rb +24 -9
  142. data/lib/cucumber/ast/features.rb +4 -0
  143. data/lib/cucumber/ast/outline_table.rb +74 -4
  144. data/lib/cucumber/ast/py_string.rb +5 -1
  145. data/lib/cucumber/ast/scenario.rb +31 -7
  146. data/lib/cucumber/ast/scenario_outline.rb +17 -9
  147. data/lib/cucumber/ast/step.rb +8 -5
  148. data/lib/cucumber/ast/step_collection.rb +14 -1
  149. data/lib/cucumber/ast/step_invocation.rb +29 -15
  150. data/lib/cucumber/ast/table.rb +9 -1
  151. data/lib/cucumber/ast/tags.rb +9 -1
  152. data/lib/cucumber/ast/visitor.rb +6 -2
  153. data/lib/cucumber/cli/configuration.rb +134 -105
  154. data/lib/cucumber/cli/main.rb +35 -12
  155. data/lib/cucumber/core_ext/proc.rb +9 -13
  156. data/lib/cucumber/formatter/ansicolor.rb +1 -1
  157. data/lib/cucumber/formatter/console.rb +36 -14
  158. data/lib/cucumber/formatter/cucumber.css +31 -12
  159. data/lib/cucumber/formatter/duration.rb +10 -0
  160. data/lib/cucumber/formatter/html.rb +76 -16
  161. data/lib/cucumber/formatter/junit.rb +79 -0
  162. data/lib/cucumber/formatter/pretty.rb +19 -14
  163. data/lib/cucumber/formatter/profile.rb +1 -1
  164. data/lib/cucumber/formatter/progress.rb +12 -12
  165. data/lib/cucumber/formatter/rerun.rb +1 -0
  166. data/lib/cucumber/formatter/tag_cloud.rb +28 -0
  167. data/lib/cucumber/formatter/usage.rb +5 -5
  168. data/lib/cucumber/formatters/unicode.rb +5 -0
  169. data/lib/cucumber/languages.yml +111 -34
  170. data/lib/cucumber/parser/feature.rb +237 -36
  171. data/lib/cucumber/parser/feature.tt +68 -30
  172. data/lib/cucumber/parser/treetop_ext.rb +12 -3
  173. data/lib/cucumber/rails/rspec.rb +5 -3
  174. data/lib/cucumber/rails/world.rb +29 -4
  175. data/lib/cucumber/rake/task.rb +125 -37
  176. data/lib/cucumber/rspec_neuter.rb +23 -0
  177. data/lib/cucumber/step_definition.rb +5 -2
  178. data/lib/cucumber/step_match.rb +10 -6
  179. data/lib/cucumber/step_mother.rb +98 -26
  180. data/lib/cucumber/version.rb +3 -3
  181. data/lib/cucumber/world.rb +2 -2
  182. data/lib/cucumber.rb +7 -2
  183. data/rails_generators/cucumber/USAGE +0 -3
  184. data/rails_generators/cucumber/cucumber_generator.rb +51 -44
  185. data/rails_generators/cucumber/templates/cucumber.rake +5 -5
  186. data/rails_generators/cucumber/templates/cucumber_environment.rb +23 -0
  187. data/rails_generators/cucumber/templates/de/paths.rb +27 -0
  188. data/rails_generators/cucumber/templates/de/webrat_steps.rb +139 -0
  189. data/rails_generators/cucumber/templates/en/paths.rb +27 -0
  190. data/rails_generators/cucumber/templates/{webrat_steps.rb → en/webrat_steps.rb} +26 -2
  191. data/rails_generators/cucumber/templates/env.rb +1 -1
  192. data/rails_generators/feature/USAGE +0 -3
  193. data/rails_generators/feature/feature_generator.rb +6 -30
  194. data/spec/cucumber/ast/feature_element_spec.rb +40 -0
  195. data/spec/cucumber/ast/py_string_spec.rb +4 -0
  196. data/spec/cucumber/ast/table_spec.rb +21 -5
  197. data/spec/cucumber/ast/visitor_spec.rb +27 -0
  198. data/spec/cucumber/cli/configuration_spec.rb +75 -54
  199. data/spec/cucumber/cli/main_spec.rb +60 -154
  200. data/spec/cucumber/formatter/color_io_spec.rb +1 -0
  201. data/spec/cucumber/formatter/duration_spec.rb +22 -0
  202. data/spec/cucumber/formatter/progress_spec.rb +36 -0
  203. data/spec/cucumber/parser/feature_parser_spec.rb +102 -1
  204. data/spec/cucumber/step_mother_spec.rb +23 -5
  205. metadata +79 -22
  206. data/examples/java/Rakefile +0 -12
  207. data/examples/self_test/features/support/tag_count_formatter.rb +0 -25
  208. data/lib/cucumber/formatter.rb +0 -1
  209. data/rails_generators/cucumber/templates/paths.rb +0 -29
  210. data/spec/cucumber/formatters/profile_formatter_spec.rb +0 -198
@@ -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 /esmu ievadījis kalkulatorā (\d+)/ do |n|
15
+ @calc.push n.to_i
16
+ end
17
+
18
+ When /nospiežu pogu (\w+)/ do |op|
19
+ @result = @calc.send op
20
+ end
21
+
22
+ Then /rezultātam uz ekrāna ir jābūt (.*)/ 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
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
2
  require 'cucumber/rake/task'
3
3
 
4
4
  Cucumber::Rake::Task.new do |t|
5
- t.cucumber_opts = "--language no"
5
+ t.cucumber_opts = %w{--language no}
6
6
  end
@@ -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{--language pl}
6
+ end
@@ -0,0 +1,16 @@
1
+ Właściwość: Dodawanie
2
+ W celu uniknięcia głupich błędów
3
+ Jako matematyczny idiota
4
+ Chcę sprawdzić wartość sumy dwóch liczb
5
+
6
+ Szablon scenariusza: Dodaj dwie liczby
7
+ Zakładając wprowadzenie do kalkulatora liczby <liczba_1>
8
+ Oraz wprowadzenie do kalkulatora liczby <liczba_2>
9
+ Jeżeli nacisnę <przycisk>
10
+ Wtedy rezultat <wynik> wyświetli się na ekranie
11
+
12
+ Przykłady:
13
+ | liczba_1 | liczba_2 | przycisk | wynik |
14
+ | 20 | 30 | dodaj | 50 |
15
+ | 2 | 5 | dodaj | 7 |
16
+ | 0 | 40 | dodaj | 40 |
@@ -0,0 +1,9 @@
1
+ Właściwość: Dzielenie
2
+ W celu uniknięcia głupich błędów
3
+ Kasjer musi znać się na ułamkach
4
+
5
+ Scenariusz: Zwykłe liczby
6
+ Zakładając wprowadzenie do kalkulatora liczby 3
7
+ Oraz wprowadzenie do kalkulatora liczby 2
8
+ Jeżeli nacisnę podziel
9
+ Wtedy rezultat 1.5 wyświetli się na ekranie
@@ -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
+ Zakładając /wprowadzenie do kalkulatora liczby (\d+)/ do |n|
15
+ @calc.push n.to_i
16
+ end
17
+
18
+ Jeżeli /nacisnę (\w+)/ do |op|
19
+ @result = @calc.send op
20
+ end
21
+
22
+ Wtedy /rezultat (.*) wyświetli się na ekranie/ do |result|
23
+ @result.should == result.to_f
24
+ end
@@ -0,0 +1,6 @@
1
+ # encoding: utf-8
2
+ require 'spec/expectations'
3
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
4
+ require 'cucumber/formatter/unicode'
5
+ require 'calculator'
6
+ $KCODE='u' unless Cucumber::RUBY_1_9
@@ -0,0 +1,14 @@
1
+ class Calculator
2
+ def push(n)
3
+ @args ||= []
4
+ @args << n
5
+ end
6
+
7
+ def dodaj
8
+ @args.inject(0){|n,sum| sum+=n}
9
+ end
10
+
11
+ def podziel
12
+ @args[0].to_f / @args[1].to_f
13
+ end
14
+ end
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
2
  require 'cucumber/rake/task'
3
3
 
4
4
  Cucumber::Rake::Task.new do |t|
5
- t.cucumber_opts = "--language pt"
5
+ t.cucumber_opts = %w{--language pt}
6
6
  end
@@ -1,8 +1,4 @@
1
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 'calculadora'
6
2
 
7
3
  Before do
8
4
  @calc = Calculadora.new
@@ -11,14 +7,14 @@ end
11
7
  After do
12
8
  end
13
9
 
14
- Given /que eu digitei (\d+) na calculadora/ do |n|
10
+ Dado /que eu digitei (\d+) na calculadora/ do |n|
15
11
  @calc.push n.to_i
16
12
  end
17
13
 
18
- When 'eu aperto o botão de soma' do
14
+ Quando 'eu aperto o botão de soma' do
19
15
  @result = @calc.soma
20
16
  end
21
17
 
22
- Then /o resultado na calculadora deve ser (\d*)/ do |result|
18
+ Então /o resultado na calculadora deve ser (\d*)/ do |result|
23
19
  @result.should == result.to_i
24
20
  end
@@ -0,0 +1,6 @@
1
+ # encoding: utf-8
2
+ $KCODE='u' unless Cucumber::RUBY_1_9
3
+ require 'spec/expectations'
4
+ $:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
5
+ require 'cucumber/formatter/unicode'
6
+ require 'calculadora'
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
2
  require 'cucumber/rake/task'
3
3
 
4
4
  Cucumber::Rake::Task.new do |t|
5
- t.cucumber_opts = "--language ro"
5
+ t.cucumber_opts = %w{--language ro}
6
6
  end
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
2
  require 'cucumber/rake/task'
3
3
 
4
4
  Cucumber::Rake::Task.new do |t|
5
- t.cucumber_opts = "--language ru"
5
+ t.cucumber_opts = %w{--language ru}
6
6
  end
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
2
  require 'cucumber/rake/task'
3
3
 
4
4
  Cucumber::Rake::Task.new do |t|
5
- t.cucumber_opts = "--language se"
5
+ t.cucumber_opts = %w{--language se}
6
6
  end
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
2
  require 'cucumber/rake/task'
3
3
 
4
4
  Cucumber::Rake::Task.new do |t|
5
- t.cucumber_opts = "--language sk"
5
+ t.cucumber_opts = %w{--language sk}
6
6
  end
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
2
  require 'cucumber/rake/task'
3
3
 
4
4
  Cucumber::Rake::Task.new do |t|
5
- t.cucumber_opts = "--language zh-CN"
5
+ t.cucumber_opts = %w{--language zh-CN}
6
6
  end
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
2
  require 'cucumber/rake/task'
3
3
 
4
4
  Cucumber::Rake::Task.new do |t|
5
- t.cucumber_opts = "--language zh-TW"
5
+ t.cucumber_opts = %w{--language zh-TW}
6
6
  end
@@ -1,11 +1,10 @@
1
1
  h1. Using Cucumber with Java
2
2
 
3
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
4
 
6
5
  h2. Installing required gems
7
6
 
8
- jruby -S gem install aslakhellesoy-cucumber
7
+ jruby -S gem install cucumber
9
8
  jruby -S gem install diff-lcs
10
9
 
11
10
  h2. Running the scenarios
@@ -13,10 +12,7 @@ h2. Running the scenarios
13
12
  Open a shell in this directory (java) and execute the following command:
14
13
 
15
14
  <pre><code>
16
- jruby -S rake features
15
+ ant
17
16
  </code></pre>
18
17
 
19
- This will compile the java code and package it in a jar file, and then run Cucumber against
20
- that code.
21
-
22
18
  There is a deliberate error. See if you can fix it!
@@ -0,0 +1,33 @@
1
+ <project name="Cucumber Demo" default="cucumber" basedir=".">
2
+ <target name ="compile" description="Compile classes">
3
+ <mkdir dir="build" />
4
+ <javac srcdir="src" destdir="build" />
5
+ </target>
6
+
7
+ <target name="cucumber" depends="compile" description="Run Cucumber">
8
+ <property environment="ENV" />
9
+ <fail unless="ENV.JRUBY_HOME">
10
+ (::) ERROR (::)
11
+ Define JRUBY_HOME in your shell. For example:
12
+
13
+ export JRUBY_HOME=/usr/local/jruby
14
+ set JRUBY_HOME=C:\jruby
15
+ </fail>
16
+ <java classname="org.jruby.Main" fork="true" failonerror="true">
17
+ <classpath>
18
+ <pathelement path="${ENV.JRUBY_HOME}/lib/jruby.jar"/>
19
+ <pathelement path="build"/>
20
+ </classpath>
21
+ <jvmarg value="-Djruby.home=${ENV.JRUBY_HOME}"/>
22
+ <arg value="-S"/>
23
+ <arg value="cucumber"/>
24
+ <arg value="--format"/>
25
+ <arg value="pretty"/>
26
+ <arg value="--format"/>
27
+ <arg value="junit"/>
28
+ <arg value="--out"/>
29
+ <arg value="build"/>
30
+ <arg value="features"/>
31
+ </java>
32
+ </target>
33
+ </project>
@@ -1,6 +1,4 @@
1
1
  require 'spec/expectations' # so we can call .should
2
- $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../src') # so the jar is found
3
- require 'cucumber_demo' # puts the jar on the classpath
4
2
  include_class 'cucumber.demo.Hello'
5
3
 
6
4
  Given /my name is (\w+)/ do |name|
@@ -0,0 +1,8 @@
1
+ Feature: One passing scenario, one failing scenario
2
+
3
+ Scenario: Passing
4
+ Given a passing scenario
5
+
6
+ Scenario: Failing
7
+ Given a failing scenario
8
+
@@ -0,0 +1,5 @@
1
+ Feature: Pending step
2
+
3
+ Scenario: Pending
4
+ Given a pending step
5
+
@@ -0,0 +1,11 @@
1
+ Given /a passing scenario/ do
2
+ #does nothing
3
+ end
4
+
5
+ Given /a failing scenario/ do
6
+ fail
7
+ end
8
+
9
+ Given /a pending step/ do
10
+ pending
11
+ end
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__) + '/../../lib')
2
2
  require 'cucumber/rake/task'
3
3
 
4
4
  Cucumber::Rake::Task.new do |t|
5
- t.cucumber_opts = "--format pretty"
5
+ t.cucumber_opts = %w{--format pretty}
6
6
  end
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__) + '/../../lib')
2
2
  require 'cucumber/rake/task'
3
3
 
4
4
  Cucumber::Rake::Task.new do |t|
5
- t.cucumber_opts = "--format pretty"
5
+ t.cucumber_opts = %w{--format pretty}
6
6
  end
File without changes
@@ -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 http://rspec.info/
9
+ Then I should see a link to RSpec-1.2.4: Home
@@ -4,10 +4,10 @@ end
4
4
 
5
5
  When /I search for "(.*)"/ do |query|
6
6
  fill_in('q', :with => query)
7
- click_button('btnG')
7
+ click_button 'Google Search'
8
8
  selenium.wait_for_page_to_load
9
9
  end
10
10
 
11
11
  Then /I should see a link to (.*)/ do |expected_url|
12
- click_link(expected_url)
12
+ click_link expected_url
13
13
  end
@@ -17,6 +17,7 @@ require 'spec/expectations'
17
17
 
18
18
  # Webrat
19
19
  require 'webrat'
20
+
20
21
  Webrat.configure do |config|
21
22
  config.mode = :selenium
22
23
  end
@@ -31,11 +32,14 @@ end
31
32
 
32
33
  # START HACK
33
34
  # Disable Rails-specific code
34
- module Webrat
35
- def self.start_app_server
35
+ class Webrat::Selenium::ApplicationServer
36
+ def self.boot
37
+
38
+ STDOUT.puts "Starting app server"
36
39
  end
37
40
 
38
- def self.stop_app_server
41
+ def self.stop_at_exit
42
+ STDOUT.puts "Stopping app server"
39
43
  end
40
44
  end
41
45
  # END HACK
@@ -0,0 +1,12 @@
1
+ @background_tagged_before_on_outline
2
+ Feature: Background tagged Before on Outline
3
+
4
+ Background:
5
+ Given passing without a table
6
+
7
+ Scenario Outline: passing background
8
+ Then I should have '<count>' cukes
9
+
10
+ Examples:
11
+ | count |
12
+ | 888 |
@@ -1,3 +1,4 @@
1
+ @after_file
1
2
  Feature: Failing background sample
2
3
 
3
4
  Background:
@@ -4,7 +4,7 @@ Feature: Passing background sample
4
4
  Given '10' cukes
5
5
 
6
6
  Scenario: passing background
7
- Then I should have '10' cukes
8
-
7
+ Then I should have '10' cukes
8
+
9
9
  Scenario: another passing background
10
10
  Then I should have '10' cukes
@@ -0,0 +1,27 @@
1
+ Feature: multiline
2
+
3
+ Background: I'm a multiline name
4
+ which goes on and on and on for three lines
5
+ yawn
6
+ Given passing without a table
7
+
8
+ Scenario: I'm a multiline name
9
+ which goes on and on and on for three lines
10
+ yawn
11
+ Given passing without a table
12
+
13
+ Scenario Outline: I'm a multiline name
14
+ which goes on and on and on for three lines
15
+ yawn
16
+ Given <state> without a table
17
+ Examples:
18
+ | state |
19
+ |passing|
20
+
21
+ Scenario Outline: name
22
+ Given <state> without a table
23
+ Examples: I'm a multiline name
24
+ which goes on and on and on for three lines
25
+ yawn
26
+ | state |
27
+ |passing|
@@ -1,3 +1,4 @@
1
+ # Feature comment
1
2
  @one
2
3
  Feature: Sample
3
4
 
@@ -5,6 +6,7 @@ Feature: Sample
5
6
  Scenario: Missing
6
7
  Given missing
7
8
 
9
+ # Scenario comment
8
10
  @three
9
11
  Scenario: Passing
10
12
  Given passing
@@ -0,0 +1,32 @@
1
+ Feature: search examples
2
+
3
+ Background: Hantu Pisang background match
4
+ Given passing without a table
5
+
6
+ Scenario: should match Hantu Pisang
7
+ Given passing without a table
8
+
9
+ Scenario: Ignore me
10
+ Given failing without a table
11
+
12
+ Scenario Outline: Ignore me
13
+ Given <state> without a table
14
+ Examples:
15
+ | state |
16
+ | failing |
17
+
18
+ Scenario Outline: Hantu Pisang match
19
+ Given <state> without a table
20
+ Examples:
21
+ | state |
22
+ | passing |
23
+
24
+ Scenario Outline: no match in name but in examples
25
+ Given <state> without a table
26
+ Examples: Hantu Pisang
27
+ | state |
28
+ | passing |
29
+
30
+ Examples: Ignore me
31
+ | state |
32
+ | failing |
@@ -68,3 +68,14 @@ end
68
68
 
69
69
  Given /^another unused$/ do
70
70
  end
71
+
72
+ after_file = File.expand_path(File.dirname(__FILE__) + '/../../tmp/after.txt')
73
+
74
+ Before do
75
+ FileUtils.rm(after_file) if File.exist?(after_file)
76
+ end
77
+
78
+ After('@after_file') do
79
+ FileUtils.mkdir_p(File.dirname(after_file))
80
+ FileUtils.touch(after_file)
81
+ end
@@ -1 +1,17 @@
1
- require 'spec/expectations'
1
+ require 'spec/expectations'
2
+
3
+ Before('@not_used') do
4
+ raise "Should never run"
5
+ end
6
+
7
+ After('@not_used') do
8
+ raise "Should never run"
9
+ end
10
+
11
+ Before('@background_tagged_before_on_outline') do
12
+ @cukes = '888'
13
+ end
14
+
15
+ After('@background_tagged_before_on_outline') do
16
+ @cukes.should == '888'
17
+ end
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__) + '/../../lib')
2
2
  require 'cucumber/rake/task'
3
3
 
4
4
  Cucumber::Rake::Task.new do |t|
5
- t.cucumber_opts = "--format pretty"
5
+ t.cucumber_opts = %w{--format pretty}
6
6
  end
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__) + '/../../lib')
2
2
  require 'cucumber/rake/task'
3
3
 
4
4
  Cucumber::Rake::Task.new do |t|
5
- t.cucumber_opts = "--format pretty"
5
+ t.cucumber_opts = %w{--format pretty}
6
6
  end
@@ -2,15 +2,15 @@ $:.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 -q"
5
+ t.cucumber_opts = %w{--tags ~@intentional_failure --format pretty -q}
6
6
  end
7
7
 
8
8
  Cucumber::Rake::Task.new(:html) do |t|
9
- t.cucumber_opts = "--format html --out features.html"
9
+ t.cucumber_opts = %w{--tags ~@intentional_failure --format html --out features.html}
10
10
  end
11
11
 
12
12
  Cucumber::Rake::Task.new(:progress) do |t|
13
- t.cucumber_opts = "--format progress -i -n"
13
+ t.cucumber_opts = %w{--tags ~@intentional_failure --format progress -i -s}
14
14
  end
15
15
 
16
16
  task :default => [:pretty, :html, :progress]
@@ -0,0 +1,8 @@
1
+ Feature: Tagged hooks
2
+ In order to provide more flexible setups
3
+ I should be able to specify exactly
4
+ where hooks are executed
5
+
6
+ @i_am_so_special
7
+ Scenario: Yes I am
8
+ When special me goes to town
@@ -0,0 +1,14 @@
1
+ require 'spec/expectations'
2
+
3
+ Before('@i_am_so_special') do
4
+ @something_special = 10
5
+ end
6
+
7
+ After('@i_am_so_special') do
8
+ @something_special.should == 20
9
+ end
10
+
11
+ When /special me goes to town/ do
12
+ @something_special.should == 10
13
+ @something_special = 20
14
+ end
@@ -1,13 +1,13 @@
1
1
  Feature: Unsubstituted argument placeholder
2
2
 
3
3
  Scenario Outline: See Annual Leave Details (as Management & Human Resource)
4
- Given the following users exist in the system
5
- | name | email | role_assignments | group_memberships |
6
- | Jane | jane@fmail.com | <role> | Sales (manager) |
7
- | Max | max@fmail.com | | Sales (member) |
8
- | Carol | carol@fmail.com | | Sales (member) |
9
- | Cat | cat@fmail.com | | |
4
+ Given the following users exist in the system
5
+ | name | email | role_assignments | group_memberships |
6
+ | Jane | jane@fmail.com | <role> | Sales (manager) |
7
+ | Max | max@fmail.com | | Sales (member) |
8
+ | Carol | carol@fmail.com | | Sales (member) |
9
+ | Cat | cat@fmail.com | | |
10
10
 
11
- Examples:
12
- | role |
13
- | HUMAN RESOURCE |
11
+ Examples:
12
+ | role |
13
+ | HUMAN RESOURCE |
@@ -0,0 +1,26 @@
1
+ @intentional_failure
2
+ Feature: Hooks
3
+ In order to integrate with my complex environment
4
+ I need to check scenario status in an After block
5
+
6
+ @272_failed
7
+ Scenario: Failed
8
+ Given I fail
9
+
10
+ @272_undefined
11
+ Scenario: Undefined
12
+ Given I am undefined
13
+
14
+ @272_passed
15
+ Scenario: Passed
16
+ Given I pass
17
+
18
+ @272_outline
19
+ Scenario Outline: Should work too
20
+ Given <something>
21
+
22
+ Examples:
23
+ | something |
24
+ | I fail |
25
+ | I am undefined |
26
+ | I pass |