cucumber 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. data/.gitattributes +1 -0
  2. data/.gitignore +17 -0
  3. data/History.txt +27 -0
  4. data/{License.txt → LICENSE} +0 -0
  5. data/Manifest.txt +0 -487
  6. data/README.rdoc +26 -0
  7. data/Rakefile +54 -7
  8. data/VERSION.yml +4 -0
  9. data/bin/cucumber +1 -1
  10. data/cucumber.gemspec +743 -0
  11. data/cucumber.yml +3 -1
  12. data/examples/cs/.gitignore +1 -0
  13. data/examples/i18n/Rakefile +1 -1
  14. data/examples/i18n/de/.gitignore +1 -0
  15. data/examples/i18n/en/.gitignore +1 -0
  16. data/examples/i18n/fi/.gitignore +1 -0
  17. data/examples/i18n/hu/.gitignore +1 -0
  18. data/examples/i18n/id/.gitignore +1 -0
  19. data/examples/i18n/ja/.gitignore +1 -0
  20. data/examples/i18n/ko/.gitignore +1 -0
  21. data/examples/i18n/lt/.gitignore +1 -0
  22. data/examples/i18n/pl/.gitignore +1 -0
  23. data/examples/i18n/sk/.gitignore +1 -0
  24. data/examples/i18n/sr-latn/Rakefile +6 -0
  25. data/examples/i18n/sr-latn/features/sabiranje.feature +18 -0
  26. data/examples/i18n/sr-latn/features/step_definitons/calculator_steps.rb +24 -0
  27. data/examples/i18n/sr-latn/lib/calculator.rb +12 -0
  28. data/examples/i18n/sr/Rakefile +6 -0
  29. data/examples/i18n/sr/features/sabiranje.feature +18 -0
  30. data/examples/i18n/sr/features/step_definitons/calculator_steps.rb +24 -0
  31. data/examples/i18n/sr/lib/calculator.rb +12 -0
  32. data/examples/i18n/tr/.gitignore +1 -0
  33. data/examples/i18n/tr/features/{bo/314/210lme.feature → bolme.feature} +0 -0
  34. data/examples/i18n/tr/features/step_definitons/{hesap_makinesi_ad/304/261mlar/304/261.rb → hesap_makinesi_adimlari.rb} +0 -0
  35. data/examples/i18n/zh-TW/.gitignore +1 -0
  36. data/examples/java/.gitignore +1 -0
  37. data/examples/java/src/.gitignore +1 -0
  38. data/examples/java/src/cucumber/demo/.gitignore +1 -0
  39. data/examples/python/lib/.gitignore +1 -0
  40. data/examples/ruby2python/lib/.gitignore +1 -0
  41. data/examples/self_test/.gitignore +1 -0
  42. data/features/background.feature +0 -3
  43. data/features/bug_464.feature +16 -0
  44. data/features/cucumber_cli.feature +4 -6
  45. data/features/cucumber_cli_diff_disabled.feature +0 -2
  46. data/features/cucumber_cli_outlines.feature +0 -4
  47. data/features/drb_server_integration.feature +1 -0
  48. data/features/exception_in_after_block.feature +0 -2
  49. data/features/exception_in_after_step_block.feature +0 -2
  50. data/features/exception_in_before_block.feature +0 -2
  51. data/features/junit_formatter.feature +0 -1
  52. data/features/language_help.feature +40 -38
  53. data/features/listener_debugger_formatter.feature +41 -0
  54. data/features/post_configuration_hook.feature +1 -1
  55. data/features/report_called_undefined_steps.feature +0 -1
  56. data/features/step_definitions/simplest_steps.rb +0 -3
  57. data/features/support/env.rb +5 -1
  58. data/features/transform.feature +1 -1
  59. data/features/usage_and_stepdefs_formatter.feature +1 -3
  60. data/features/work_in_progress.feature +0 -2
  61. data/gem_tasks/features.rake +6 -1
  62. data/gem_tasks/rspec.rake +5 -35
  63. data/gem_tasks/sdoc.rake +10 -5
  64. data/lib/autotest/cucumber_mixin.rb +6 -0
  65. data/lib/cucumber.rb +0 -1
  66. data/lib/cucumber/ast/step_invocation.rb +3 -0
  67. data/lib/cucumber/cli/configuration.rb +7 -2
  68. data/lib/cucumber/cli/options.rb +8 -7
  69. data/lib/cucumber/core_ext/proc.rb +1 -0
  70. data/lib/cucumber/formatter/ansicolor.rb +0 -9
  71. data/lib/cucumber/formatter/console.rb +14 -12
  72. data/lib/cucumber/formatter/debug.rb +33 -0
  73. data/lib/cucumber/formatter/pretty.rb +2 -2
  74. data/lib/cucumber/formatter/rerun.rb +9 -6
  75. data/lib/cucumber/language_support/language_methods.rb +2 -2
  76. data/lib/cucumber/languages.yml +37 -1
  77. data/lib/cucumber/platform.rb +3 -1
  78. data/lib/cucumber/py_support/py_language.py +1 -1
  79. data/lib/cucumber/py_support/py_language.rb +2 -2
  80. data/lib/cucumber/rb_support/rb_language.rb +6 -7
  81. data/lib/cucumber/rb_support/rb_step_definition.rb +0 -1
  82. data/lib/cucumber/rb_support/rb_world.rb +1 -2
  83. data/lib/cucumber/step_match.rb +10 -7
  84. data/lib/cucumber/step_mother.rb +6 -3
  85. data/rails_generators/cucumber/cucumber_generator.rb +49 -6
  86. data/spec/cucumber/cli/options_spec.rb +1 -1
  87. data/spec/cucumber/formatter/console_spec.rb +20 -0
  88. data/spec/cucumber/step_match_spec.rb +10 -5
  89. metadata +258 -43
  90. data/README.txt +0 -4
  91. data/config/hoe.rb +0 -84
  92. data/config/requirements.rb +0 -15
  93. data/gem_tasks/deployment.rake +0 -11
  94. data/gem_tasks/gemspec.rake +0 -10
  95. data/lib/cucumber/language_support/step_definition_methods.rb +0 -23
  96. data/lib/cucumber/version.rb +0 -10
@@ -1,2 +1,4 @@
1
- default: --format progress --tags ~@proposed,~@wip --strict features
1
+ default: --format progress --strict features
2
+ jruby: --format progress --tags ~@spork --strict features
3
+ windows_mri: --format progress --tags ~@spork --strict features
2
4
  wip: --tags @wip --wip features
@@ -0,0 +1 @@
1
+ *.dll
@@ -24,7 +24,7 @@ end
24
24
  task :default => :i18n
25
25
 
26
26
  def examples_working?(lang)
27
- !%w{ro}.index(lang)
27
+ !%w{}.index(lang)
28
28
  end
29
29
 
30
30
  def rake(args)
@@ -0,0 +1 @@
1
+ features.html
@@ -0,0 +1 @@
1
+ features.html
@@ -0,0 +1 @@
1
+ features.html
@@ -0,0 +1 @@
1
+ features.html
@@ -0,0 +1 @@
1
+ features.html
@@ -0,0 +1 @@
1
+ features.html
@@ -0,0 +1 @@
1
+ features.html
@@ -0,0 +1 @@
1
+ features.html
@@ -0,0 +1 @@
1
+ features.html
@@ -0,0 +1 @@
1
+ features.html
@@ -0,0 +1,6 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new do |t|
5
+ t.cucumber_opts = %w{--format pretty}
6
+ end
@@ -0,0 +1,18 @@
1
+ # language: sr-Latn
2
+ Funkcionalnost: Sabiranje
3
+ Da bih izbegao smešne greske
4
+ Kao matematička neznalica
5
+ Želim da mogu da izračunam zbir dva broja
6
+
7
+ Struktura scenarija: Dodaj dva broja
8
+ Zadato Unesen <input_1> broj u kalkulator
9
+ I Unesen <input_2> broj u kalkulator
10
+ Kada pritisnem <button>
11
+ Onda bi trebalo da bude <output> prikazano na ekranu
12
+
13
+ Primeri:
14
+ | input_1 | input_2 | button | output |
15
+ | 20 | 30 | add | 50 |
16
+ | 25 | 45 | add | 70 |
17
+ | 7 | 77 | add | 84 |
18
+ | 11 | 12 | add | 23 |
@@ -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
+ Zadato /Unesen (\d+) broj u kalkulator/ do |n|
15
+ @calc.push n.to_i
16
+ end
17
+
18
+ Kada /pritisnem (\w+)/ do |op|
19
+ @result = @calc.send op
20
+ end
21
+
22
+ Onda /bi trebalo da bude (.*) prikazano na ekranu/ do |result|
23
+ @result.to_f == result.to_f
24
+ end
@@ -0,0 +1,12 @@
1
+ class Calculator
2
+
3
+ def push(n)
4
+ @args ||= []
5
+ @args << n
6
+ end
7
+
8
+ def add
9
+ @args.inject(0){|n,sum| sum+=n}
10
+ end
11
+
12
+ 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{--format pretty}
6
+ end
@@ -0,0 +1,18 @@
1
+ # language: sr
2
+ Функционалност: Сабиранје
3
+ Да бих избегао смешне грешке
4
+ Као математичка незналица
5
+ Желим да могу да израчунам збир два броја
6
+
7
+ Концепт: Додај два броја
8
+ Задати унесен број <input_1> у калкулатор
9
+ И унесен број <input_2> у калкулатор
10
+ Када притиснем <button>
11
+ Онда би требало да буде <output> прикаѕано на екрану
12
+
13
+ Примери:
14
+ | input_1 | input_2 | button | output |
15
+ | 20 | 30 | add | 50 |
16
+ | 25 | 45 | add | 70 |
17
+ | 7 | 77 | add | 84 |
18
+ | 11 | 12 | add | 23 |
@@ -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
+ Задати /унесен број (\d+) у калкулатор/ do |n|
15
+ @calc.push n.to_i
16
+ end
17
+
18
+ Када /притиснем (\w+)/ do |op|
19
+ @result = @calc.send op
20
+ end
21
+
22
+ Онда /би требало да буде (.*) прикаѕано на екрану/ do |result|
23
+ @result.to_f == result.to_f
24
+ end
@@ -0,0 +1,12 @@
1
+ class Calculator
2
+
3
+ def push(n)
4
+ @args ||= []
5
+ @args << n
6
+ end
7
+
8
+ def add
9
+ @args.inject(0){|n,sum| sum+=n}
10
+ end
11
+
12
+ end
@@ -0,0 +1 @@
1
+ features.html
@@ -0,0 +1 @@
1
+ features.html
@@ -0,0 +1 @@
1
+ build
@@ -0,0 +1 @@
1
+ cucumber_demo.jar
@@ -0,0 +1 @@
1
+ *.pyc
@@ -0,0 +1 @@
1
+ *.pyc
@@ -0,0 +1 @@
1
+ tmp
@@ -90,7 +90,6 @@ Feature: backgrounds
90
90
 
91
91
  """
92
92
 
93
- @mri186
94
93
  Scenario: run a feature with a background that fails
95
94
  When I run cucumber -q features/background/failing_background.feature --require features
96
95
  Then it should fail with
@@ -121,7 +120,6 @@ Feature: backgrounds
121
120
  """
122
121
  And "examples/self_test/tmp/after.txt" should exist
123
122
 
124
- @mri186
125
123
  Scenario: run a feature with scenario outlines that has a background that fails
126
124
  When I run cucumber -q features/background/scenario_outline_failing_background.feature --require features
127
125
  Then it should fail with
@@ -174,7 +172,6 @@ Feature: backgrounds
174
172
 
175
173
  """
176
174
 
177
- @mri186
178
175
  Scenario: background passes with first scenario but fails with second
179
176
  When I run cucumber -q features/background/failing_background_after_success.feature --require features
180
177
  Then it should fail with
@@ -0,0 +1,16 @@
1
+ Feature: https://rspec.lighthouseapp.com/projects/16211/tickets/464
2
+ Scenario: Limiting with tags which do not exist in the features
3
+ Given a standard Cucumber project directory structure
4
+ And a file named "features/f.feature" with:
5
+ """
6
+ Feature: Test
7
+ In order to test
8
+ As a tester
9
+ I want to test
10
+
11
+ @tag
12
+ Scenario: Testing
13
+ Given I'm a test
14
+ """
15
+ When I run cucumber -q features/f.feature --tag @i_dont_exist
16
+ Then it should pass
@@ -58,7 +58,6 @@ Feature: Cucumber command line
58
58
 
59
59
  """
60
60
 
61
- @mri186
62
61
  Scenario: Specify 2 line numbers where one is a tag
63
62
  When I run cucumber -q features/sample.feature:5:16
64
63
  Then it should fail with
@@ -147,7 +146,6 @@ Feature: Cucumber command line
147
146
 
148
147
  """
149
148
 
150
- @mri186
151
149
  Scenario: Run all with progress formatter
152
150
  When I run cucumber -q --format progress features/sample.feature
153
151
  Then it should fail with
@@ -465,7 +463,6 @@ Feature: Cucumber command line
465
463
 
466
464
  """
467
465
 
468
- @mri186
469
466
  Scenario: Run with a tag that exists on 1 feature
470
467
  When I run cucumber -q features --tags @one
471
468
  Then it should fail with
@@ -619,12 +616,13 @@ Feature: Cucumber command line
619
616
  """
620
617
 
621
618
  Scenario: Generate PDF with pdf formatter
622
- When I run cucumber --format pdf --out tmp/sample.pdf --dry-run features/sample.feature
623
- Then "examples/self_test/tmp/sample.pdf" should match "Pages 2"
619
+ When I run cucumber --format pdf --out tmp/sample.pdf --dry-run features/sample.feature
620
+ Then STDERR should be empty
621
+ Then "examples/self_test/tmp/sample.pdf" should match "Pages 2"
624
622
 
625
623
  Scenario: Run feature elements which match a name using -n
626
624
  When I run cucumber -n Pisang -q features/
627
- Then it should pass with
625
+ Then it should pass with
628
626
  """
629
627
  Feature: search examples
630
628
 
@@ -2,7 +2,6 @@ Feature: Cucumber command line
2
2
  In order to write better software
3
3
  Developers should be able to execute requirements as tests
4
4
 
5
- @mri186
6
5
  Scenario: Run single failing scenario with default diff enabled
7
6
  When I run cucumber -q features/failing_expectation.feature
8
7
  Then it should fail with
@@ -30,7 +29,6 @@ Feature: Cucumber command line
30
29
 
31
30
  """
32
31
 
33
- @mri186
34
32
  Scenario: Run single failing scenario with diff output disabled
35
33
  When I run cucumber -q --no-diff features/failing_expectation.feature
36
34
  Then it should fail with
@@ -2,7 +2,6 @@ Feature: Cucumber command line
2
2
  In order to write better software
3
3
  Developers should be able to execute requirements as tests
4
4
 
5
- @mri186
6
5
  Scenario: Run scenario outline with filtering on outline name
7
6
  When I run cucumber -q features --name "Test state"
8
7
  Then it should fail with
@@ -32,7 +31,6 @@ Feature: Cucumber command line
32
31
 
33
32
  """
34
33
 
35
- @mri186
36
34
  Scenario: Run scenario outline steps only
37
35
  When I run cucumber -q features/outline_sample.feature:7
38
36
  Then it should fail with
@@ -62,7 +60,6 @@ Feature: Cucumber command line
62
60
 
63
61
  """
64
62
 
65
- @mri186
66
63
  Scenario: Run single failing scenario outline table row
67
64
  When I run cucumber features/outline_sample.feature:12
68
65
  Then it should fail with
@@ -88,7 +85,6 @@ Feature: Cucumber command line
88
85
 
89
86
  # There are 10 characters in the progress, but only 8 reported steps. Needs investigation.
90
87
  # Looks like we're outputting too many characters.
91
- @mri186
92
88
  Scenario: Run all with progress formatter
93
89
  When I run cucumber -q --format progress features/outline_sample.feature
94
90
  Then it should fail with
@@ -1,3 +1,4 @@
1
+ @spork
1
2
  Feature: DRb Server Integration
2
3
  To prevent waiting for Rails and other large Ruby applications to load their environments
3
4
  for each feature run Cucumber ships with a DRb client that can speak to a server which
@@ -24,7 +24,6 @@ Feature: Exception in After Block
24
24
  end
25
25
  """
26
26
 
27
- @mri186
28
27
  Scenario: Handle Exception in standard scenario step and carry on
29
28
  Given a file named "features/naughty_step_in_scenario.feature" with:
30
29
  """
@@ -57,7 +56,6 @@ Feature: Exception in After Block
57
56
 
58
57
  """
59
58
 
60
- @mri186
61
59
  Scenario: Handle Exception in scenario outline table row and carry on
62
60
  Given a file named "features/naughty_step_in_scenario_outline.feature" with:
63
61
  """
@@ -24,7 +24,6 @@ Feature: Exception in AfterStep Block
24
24
  end
25
25
  """
26
26
 
27
- @mri186
28
27
  Scenario: Handle Exception in standard scenario step and carry on
29
28
  Given a file named "features/naughty_step_in_scenario.feature" with:
30
29
  """
@@ -58,7 +57,6 @@ Feature: Exception in AfterStep Block
58
57
 
59
58
  """
60
59
 
61
- @mri186
62
60
  Scenario: Handle Exception in scenario outline table row and carry on
63
61
  Given a file named "features/naughty_step_in_scenario_outline.feature" with:
64
62
  """
@@ -19,7 +19,6 @@ Feature: Exception in Before Block
19
19
  end
20
20
  """
21
21
 
22
- @mri186
23
22
  Scenario: Handle Exception in standard scenario step and carry on
24
23
  Given a file named "features/naughty_step_in_scenario.feature" with:
25
24
  """
@@ -46,7 +45,6 @@ Feature: Exception in Before Block
46
45
 
47
46
  """
48
47
 
49
- @mri186
50
48
  Scenario: Handle Exception in Before hook for Scenario with Background
51
49
  Given a file named "features/naughty_step_in_before.feature" with:
52
50
  """
@@ -6,7 +6,6 @@ Feature: JUnit output formatter
6
6
  Given I am in junit
7
7
  And the tmp directory is empty
8
8
 
9
- @mri186
10
9
  Scenario: one feature, one passing scenario, one failing scenario
11
10
  When I run cucumber --format junit --out tmp/ features/one_passing_one_failing.feature
12
11
  Then it should fail with
@@ -26,43 +26,45 @@ Feature: Language help
26
26
  When I run cucumber -l help
27
27
  Then it should pass with
28
28
  """
29
- | ar | Arabic | العربية |
30
- | bg | Bulgarian | български |
31
- | cat | Catalan | català |
32
- | cy | Welsh | Cymraeg |
33
- | cz | Czech | Česky |
34
- | da | Danish | dansk |
35
- | de | German | Deutsch |
36
- | en | English | English |
37
- | en-au | Australian | Australian |
38
- | en-lol | LOLCAT | LOLCAT |
39
- | en-tx | Texan | Texan |
40
- | es | Spanish | español |
41
- | et | Estonian | eesti keel |
42
- | fi | Finnish | suomi |
43
- | fr | French | français |
44
- | he | Hebrew | עברית |
45
- | hr | Croatian | hrvatski |
46
- | hu | Hungarian | magyar |
47
- | id | Indonesian | Bahasa Indonesia |
48
- | it | Italian | italiano |
49
- | ja | Japanese | 日本語 |
50
- | ko | Korean | 한국어 |
51
- | lt | Lithuanian | lietuvių kalba |
52
- | lv | Latvian | latviešu |
53
- | nl | Dutch | Nederlands |
54
- | no | Norwegian | norsk |
55
- | pl | Polish | polski |
56
- | pt | Portuguese | português |
57
- | ro | Romanian | română |
58
- | ro2 | Romanian (diacritical) | română (diacritical) |
59
- | ru | Russian | русский |
60
- | se | Swedish | Svenska |
61
- | sk | Slovak | Slovensky |
62
- | tr | Turkish | Türkçe |
63
- | uz | Uzbek | Узбекча |
64
- | vi | Vietnamese | Tiếng Việt |
65
- | zh-CN | Chinese simplified | 简体中文 |
66
- | zh-TW | Chinese traditional | 繁體中文 |
29
+ | ar | Arabic | العربية |
30
+ | bg | Bulgarian | български |
31
+ | cat | Catalan | català |
32
+ | cy | Welsh | Cymraeg |
33
+ | cz | Czech | Česky |
34
+ | da | Danish | dansk |
35
+ | de | German | Deutsch |
36
+ | en | English | English |
37
+ | en-au | Australian | Australian |
38
+ | en-lol | LOLCAT | LOLCAT |
39
+ | en-tx | Texan | Texan |
40
+ | es | Spanish | español |
41
+ | et | Estonian | eesti keel |
42
+ | fi | Finnish | suomi |
43
+ | fr | French | français |
44
+ | he | Hebrew | עברית |
45
+ | hr | Croatian | hrvatski |
46
+ | hu | Hungarian | magyar |
47
+ | id | Indonesian | Bahasa Indonesia |
48
+ | it | Italian | italiano |
49
+ | ja | Japanese | 日本語 |
50
+ | ko | Korean | 한국어 |
51
+ | lt | Lithuanian | lietuvių kalba |
52
+ | lv | Latvian | latviešu |
53
+ | nl | Dutch | Nederlands |
54
+ | no | Norwegian | norsk |
55
+ | pl | Polish | polski |
56
+ | pt | Portuguese | português |
57
+ | ro | Romanian | română |
58
+ | ro2 | Romanian (diacritical) | română (diacritical) |
59
+ | ru | Russian | русский |
60
+ | se | Swedish | Svenska |
61
+ | sk | Slovak | Slovensky |
62
+ | sr | Serbian | Српски |
63
+ | sr-Latn | Serbian_latin | Srpski_latinica |
64
+ | tr | Turkish | Türkçe |
65
+ | uz | Uzbek | Узбекча |
66
+ | vi | Vietnamese | Tiếng Việt |
67
+ | zh-CN | Chinese simplified | 简体中文 |
68
+ | zh-TW | Chinese traditional | 繁體中文 |
67
69
 
68
70
  """