cucumber 0.1.16 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +111 -5
- data/License.txt +1 -1
- data/Manifest.txt +141 -83
- data/Rakefile +1 -1
- data/bin/cucumber +2 -2
- data/config/hoe.rb +8 -2
- data/examples/cs/features/addition.feature +4 -5
- data/examples/cs/features/step_definitons/calculator_steps.rb +1 -5
- data/examples/i18n/README.textile +1 -1
- data/examples/i18n/Rakefile +5 -5
- data/examples/i18n/ar/features/addition.feature +10 -11
- data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -10
- data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +1 -1
- data/examples/i18n/de/features/addition.feature +10 -11
- data/examples/i18n/de/features/division.feature +0 -1
- data/examples/i18n/de/features/step_definitons/calculator_steps.rb +2 -10
- data/examples/i18n/en-lol/Rakefile +6 -0
- data/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb +16 -0
- data/examples/i18n/en-lol/features/stuffing.feature +8 -0
- data/examples/i18n/en-lol/features/support/env.rb +8 -0
- data/examples/i18n/en-lol/lib/basket.rb +12 -0
- data/examples/i18n/en-lol/lib/belly.rb +11 -0
- data/examples/i18n/en/features/addition.feature +10 -11
- data/examples/i18n/en/features/division.feature +0 -1
- data/examples/i18n/en/features/step_definitons/calculator_steps.rb +2 -6
- data/examples/i18n/es/features/adicion.feature +11 -12
- data/examples/i18n/es/features/step_definitons/calculador_steps.rb +7 -10
- data/examples/i18n/es/lib/calculador.rb +4 -1
- data/examples/i18n/et/features/jagamine.feature +9 -0
- data/examples/i18n/et/features/liitmine.feature +10 -11
- data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +4 -8
- data/examples/i18n/et/lib/kalkulaator.rb +5 -1
- data/examples/i18n/fi/Rakefile +6 -0
- data/examples/i18n/fi/features/jakolasku.feature +9 -0
- data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +24 -0
- data/examples/i18n/fi/features/yhteenlasku.feature +16 -0
- data/examples/i18n/fi/lib/laskin.rb +14 -0
- data/examples/i18n/fr/features/addition.feature +14 -12
- data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +11 -13
- data/examples/i18n/fr/lib/calculatrice.rb +1 -1
- data/examples/i18n/id/features/addition.feature +10 -11
- data/examples/i18n/id/features/division.feature +0 -1
- data/examples/i18n/id/features/step_definitons/calculator_steps.rb +2 -11
- data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +1 -1
- data/examples/i18n/ja/features/addition.feature +10 -11
- data/examples/i18n/ja/features/division.feature +2 -3
- data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +4 -13
- data/examples/i18n/ko/features/addition.feature +7 -8
- data/examples/i18n/ko/features/division.feature +3 -4
- data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +1 -5
- data/examples/i18n/lt/features/addition.feature +11 -11
- data/examples/i18n/lt/features/division.feature +0 -1
- data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +2 -11
- data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +3 -10
- data/examples/i18n/no/features/summering.feature +1 -0
- data/examples/i18n/no/features/support/env.rb +6 -0
- data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +1 -1
- data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/ru/Rakefile +6 -0
- data/examples/i18n/ru/features/addition.feature +10 -0
- data/examples/i18n/ru/features/consecutive_calculations.feature +16 -0
- data/examples/i18n/ru/features/division.feature +15 -0
- data/examples/i18n/ru/features/step_definitons/calculator_steps.rb +19 -0
- data/examples/i18n/ru/features/support/env.rb +6 -0
- data/examples/i18n/ru/features/support/world.rb +7 -0
- data/examples/i18n/ru/lib/calculator.rb +24 -0
- data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +1 -1
- data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +2 -2
- data/examples/i18n/zh-TW/Rakefile +6 -0
- data/examples/i18n/zh-TW/features/addition.feature +16 -0
- data/examples/i18n/zh-TW/features/division.feature +10 -0
- data/examples/i18n/zh-TW/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/zh-TW/lib/calculator.rb +14 -0
- data/examples/java/src/cucumber/demo/Hello.java +16 -0
- data/examples/jbehave/README.textile +20 -0
- data/examples/jbehave/features/support/env.rb +7 -0
- data/examples/jbehave/features/trading.feature +28 -0
- data/examples/jbehave/pom.xml +53 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/converters/TraderConverter.java +32 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/model/Stock.java +42 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/model/Trader.java +29 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/persistence/TraderPersister.java +22 -0
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/scenarios/TraderSteps.java +70 -0
- data/examples/selenium/features/step_definitons/search_steps.rb +13 -0
- data/examples/selenium/features/support/env.rb +19 -0
- data/examples/{calculator_ruby_features → selenium_webrat}/Rakefile +0 -0
- data/examples/selenium_webrat/features/search.feature +9 -0
- data/examples/selenium_webrat/features/step_definitons/search_steps.rb +13 -0
- data/examples/selenium_webrat/features/support/env.rb +41 -0
- data/examples/self_test/README.textile +4 -1
- data/examples/self_test/Rakefile +6 -0
- data/examples/self_test/features/background/failing_background.feature +11 -0
- data/examples/self_test/features/background/failing_background_after_success.feature +11 -0
- data/examples/self_test/features/background/multiline_args_background.feature +32 -0
- data/examples/self_test/features/background/passing_background.feature +10 -0
- data/examples/self_test/features/background/pending_background.feature +10 -0
- data/examples/self_test/features/background/scenario_outline_failing_background.feature +16 -0
- data/examples/self_test/features/background/scenario_outline_passing_background.feature +16 -0
- data/examples/self_test/features/call_undefined_step_from_step_def.feature +7 -0
- data/examples/self_test/features/failing_expectation.feature +4 -0
- data/examples/self_test/features/lots_of_undefined.feature +8 -0
- data/examples/self_test/features/outline_sample.feature +11 -5
- data/examples/self_test/features/sample.feature +8 -3
- data/examples/self_test/features/step_definitions/sample_steps.rb +55 -4
- data/examples/self_test/features/support/env.rb +1 -0
- data/examples/self_test/features/support/tag_count_formatter.rb +25 -0
- data/examples/sinatra/Rakefile +6 -0
- data/examples/sinatra/app.rb +14 -0
- data/examples/sinatra/features/add.feature +11 -0
- data/examples/sinatra/features/step_definitions/add_steps.rb +15 -0
- data/examples/sinatra/features/support/env.rb +20 -0
- data/examples/sinatra/views/add.erb +5 -0
- data/examples/sinatra/views/layout.erb +8 -0
- data/examples/tickets/Rakefile +13 -8
- data/examples/tickets/cucumber.yml +2 -1
- data/examples/tickets/features/172.feature +28 -0
- data/examples/tickets/features/177/1.feature +29 -0
- data/examples/tickets/features/177/2.feature +21 -0
- data/examples/tickets/features/177/3.feature +18 -0
- data/examples/tickets/features/180.feature +7 -0
- data/examples/tickets/features/236.feature +13 -0
- data/examples/tickets/features/241.feature +13 -0
- data/examples/tickets/features/scenario_outline.feature +6 -1
- data/examples/tickets/features/step_definitons/tickets_steps.rb +41 -4
- data/examples/tickets/features/tickets.feature +5 -1
- data/features/background.feature +221 -0
- data/features/cucumber_cli.feature +263 -97
- data/features/cucumber_cli_diff_disabled.feature +45 -0
- data/features/cucumber_cli_outlines.feature +50 -42
- data/features/custom_formatter.feature +11 -0
- data/features/report_called_undefined_steps.feature +34 -0
- data/features/step_definitions/cucumber_steps.rb +6 -3
- data/features/step_definitions/extra_steps.rb +1 -1
- data/features/support/env.rb +3 -2
- data/gem_tasks/features.rake +1 -1
- data/gem_tasks/flog.rake +1 -1
- data/gem_tasks/gemspec.rake +2 -2
- data/gem_tasks/jar.rake +67 -0
- data/gem_tasks/rspec.rake +2 -0
- data/lib/autotest/cucumber_mixin.rb +18 -23
- data/lib/cucumber.rb +55 -11
- data/lib/cucumber/ast.rb +29 -0
- data/lib/cucumber/ast/background.rb +50 -0
- data/lib/cucumber/ast/comment.rb +26 -0
- data/lib/cucumber/ast/examples.rb +38 -0
- data/lib/cucumber/ast/feature.rb +62 -0
- data/lib/cucumber/ast/feature_element.rb +46 -0
- data/lib/cucumber/ast/features.rb +20 -0
- data/lib/cucumber/ast/outline_table.rb +81 -0
- data/lib/cucumber/ast/py_string.rb +58 -0
- data/lib/cucumber/ast/scenario.rb +64 -0
- data/lib/cucumber/ast/scenario_outline.rb +90 -0
- data/lib/cucumber/ast/step.rb +122 -0
- data/lib/cucumber/ast/step_collection.rb +66 -0
- data/lib/cucumber/ast/step_invocation.rb +110 -0
- data/lib/cucumber/ast/table.rb +318 -0
- data/lib/cucumber/ast/tags.rb +33 -0
- data/lib/cucumber/ast/visitor.rb +125 -0
- data/lib/cucumber/broadcaster.rb +2 -9
- data/lib/cucumber/cli/configuration.rb +364 -0
- data/lib/cucumber/cli/language_help_formatter.rb +59 -0
- data/lib/cucumber/cli/main.rb +109 -0
- data/lib/cucumber/core_ext/exception.rb +41 -8
- data/lib/cucumber/core_ext/instance_exec.rb +54 -0
- data/lib/cucumber/core_ext/proc.rb +29 -65
- data/lib/cucumber/core_ext/string.rb +19 -0
- data/lib/cucumber/formatter.rb +1 -0
- data/lib/cucumber/{formatters → formatter}/ansicolor.rb +13 -16
- data/lib/cucumber/formatter/color_io.rb +23 -0
- data/lib/cucumber/formatter/console.rb +109 -0
- data/lib/cucumber/formatter/cucumber.css +55 -0
- data/lib/cucumber/formatter/cucumber.sass +49 -0
- data/lib/cucumber/formatter/html.rb +133 -0
- data/lib/cucumber/formatter/pretty.rb +179 -0
- data/lib/cucumber/formatter/profile.rb +77 -0
- data/lib/cucumber/formatter/progress.rb +60 -0
- data/lib/cucumber/formatter/rerun.rb +35 -0
- data/lib/cucumber/formatter/unicode.rb +35 -0
- data/lib/cucumber/formatters/unicode.rb +2 -35
- data/lib/cucumber/jbehave.rb +97 -0
- data/lib/cucumber/languages.yml +196 -80
- data/lib/cucumber/parser.rb +43 -0
- data/lib/cucumber/parser/basic.rb +0 -0
- data/lib/cucumber/parser/feature.rb +1487 -0
- data/lib/cucumber/parser/feature.tt +193 -0
- data/lib/cucumber/parser/i18n.tt +31 -0
- data/lib/cucumber/parser/table.rb +402 -0
- data/lib/cucumber/parser/table.tt +59 -0
- data/lib/cucumber/parser/treetop_ext.rb +75 -0
- data/lib/cucumber/platform.rb +2 -17
- data/lib/cucumber/rails/rspec.rb +5 -9
- data/lib/cucumber/rails/world.rb +2 -2
- data/lib/cucumber/rake/task.rb +39 -7
- data/lib/cucumber/step_definition.rb +103 -0
- data/lib/cucumber/step_match.rb +49 -0
- data/lib/cucumber/step_mother.rb +183 -67
- data/lib/cucumber/version.rb +2 -2
- data/lib/cucumber/world.rb +53 -1
- data/rails_generators/cucumber/cucumber_generator.rb +22 -3
- data/rails_generators/cucumber/templates/cucumber +2 -1
- data/rails_generators/cucumber/templates/cucumber.rake +13 -5
- data/rails_generators/cucumber/templates/env.rb +4 -3
- data/rails_generators/cucumber/templates/paths.rb +18 -11
- data/rails_generators/cucumber/templates/webrat_steps.rb +41 -25
- data/rails_generators/feature/feature_generator.rb +4 -0
- data/rails_generators/feature/templates/steps.erb +0 -4
- data/spec/cucumber/ast/background_spec.rb +49 -0
- data/spec/cucumber/ast/feature_factory.rb +63 -0
- data/spec/cucumber/ast/feature_spec.rb +37 -0
- data/spec/cucumber/ast/py_string_spec.rb +47 -0
- data/spec/cucumber/ast/scenario_outline_spec.rb +67 -0
- data/spec/cucumber/ast/scenario_spec.rb +65 -0
- data/spec/cucumber/ast/step_collection_spec.rb +8 -0
- data/spec/cucumber/ast/step_spec.rb +66 -0
- data/spec/cucumber/ast/table_spec.rb +149 -0
- data/spec/cucumber/ast/tags_spec.rb +19 -0
- data/spec/cucumber/broadcaster_spec.rb +6 -18
- data/spec/cucumber/cli/configuration_spec.rb +275 -0
- data/spec/cucumber/cli/main_spec.rb +203 -0
- data/spec/cucumber/core_ext/proc_spec.rb +27 -35
- data/spec/cucumber/core_ext/string_spec.rb +8 -0
- data/spec/cucumber/{formatters → formatter}/ansicolor_spec.rb +2 -2
- data/spec/cucumber/formatter/color_io_spec.rb +26 -0
- data/spec/cucumber/formatter/html/cucumber.css +37 -0
- data/spec/cucumber/formatter/html/cucumber.js +13 -0
- data/spec/cucumber/formatter/html/index.html +45 -0
- data/spec/cucumber/formatter/html/jquery-1.3.min.js +19 -0
- data/spec/cucumber/formatter/html/jquery.uitableedit.js +100 -0
- data/spec/cucumber/formatters/profile_formatter_spec.rb +17 -16
- data/spec/cucumber/parser/feature_parser_spec.rb +282 -0
- data/spec/cucumber/parser/table_parser_spec.rb +48 -0
- data/spec/cucumber/step_definition_spec.rb +81 -0
- data/spec/cucumber/step_mother_spec.rb +50 -51
- data/spec/cucumber/treetop_parser/empty_feature.feature +1 -1
- data/spec/cucumber/treetop_parser/multiple_tables.feature +6 -8
- data/spec/cucumber/treetop_parser/scenario_outline.feature +1 -1
- data/spec/cucumber/treetop_parser/spaces.feature +3 -1
- data/spec/cucumber/treetop_parser/with_comments.feature +1 -1
- data/spec/cucumber/treetop_parser/with_tags.feature +18 -0
- data/spec/cucumber/world/pending_spec.rb +13 -12
- data/spec/spec_helper.rb +1 -1
- metadata +165 -88
- data/examples/calculator_ruby_features/features/addition.rb +0 -39
- data/examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb +0 -43
- data/examples/i18n/ja/README.txt +0 -5
- data/examples/selenium/features/step_definitons/stories_steps.rb +0 -40
- data/gem_tasks/treetop.rake +0 -41
- data/lib/cucumber/cli.rb +0 -356
- data/lib/cucumber/executor.rb +0 -205
- data/lib/cucumber/formatters.rb +0 -1
- data/lib/cucumber/formatters/autotest_formatter.rb +0 -23
- data/lib/cucumber/formatters/cucumber.css +0 -132
- data/lib/cucumber/formatters/cucumber.js +0 -11
- data/lib/cucumber/formatters/html_formatter.rb +0 -151
- data/lib/cucumber/formatters/jquery.js +0 -32
- data/lib/cucumber/formatters/pretty_formatter.rb +0 -285
- data/lib/cucumber/formatters/profile_formatter.rb +0 -92
- data/lib/cucumber/formatters/progress_formatter.rb +0 -61
- data/lib/cucumber/model.rb +0 -1
- data/lib/cucumber/model/table.rb +0 -32
- data/lib/cucumber/step_methods.rb +0 -49
- data/lib/cucumber/tree.rb +0 -16
- data/lib/cucumber/tree/feature.rb +0 -105
- data/lib/cucumber/tree/features.rb +0 -21
- data/lib/cucumber/tree/given_scenario.rb +0 -13
- data/lib/cucumber/tree/scenario.rb +0 -240
- data/lib/cucumber/tree/step.rb +0 -173
- data/lib/cucumber/tree/table.rb +0 -26
- data/lib/cucumber/tree/top_down_visitor.rb +0 -23
- data/lib/cucumber/treetop_parser/feature.treetop.erb +0 -254
- data/lib/cucumber/treetop_parser/feature_ar.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_cy.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_da.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_de.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_en-lol.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_en-tx.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_en.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_es.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_et.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_fr.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_id.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_it.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ja.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ko.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_lt.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_nl.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_no.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_parser.rb +0 -36
- data/lib/cucumber/treetop_parser/feature_pl.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_pt.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ro.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ro2.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ru.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_se.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_zh-CN.rb +0 -1951
- data/lib/cucumber/world/pending.rb +0 -22
- data/script/console +0 -10
- data/script/console.cmd +0 -1
- data/script/destroy +0 -14
- data/script/destroy.cmd +0 -1
- data/script/generate +0 -14
- data/script/generate.cmd +0 -1
- data/script/txt2html +0 -74
- data/script/txt2html.cmd +0 -1
- data/setup.rb +0 -1585
- data/spec/cucumber/cli_spec.rb +0 -521
- data/spec/cucumber/executor_spec.rb +0 -382
- data/spec/cucumber/formatters/autotest_formatter_spec.rb +0 -26
- data/spec/cucumber/formatters/features.html +0 -269
- data/spec/cucumber/formatters/html_formatter_spec.rb +0 -104
- data/spec/cucumber/formatters/pretty_formatter_spec.rb +0 -410
- data/spec/cucumber/formatters/progress_formatter_spec.rb +0 -81
- data/spec/cucumber/model/table_spec.rb +0 -32
- data/spec/cucumber/tree/feature_spec.rb +0 -122
- data/spec/cucumber/tree/row_scenario_outline_spec.rb +0 -73
- data/spec/cucumber/tree/row_scenario_spec.rb +0 -55
- data/spec/cucumber/tree/row_step_outline_spec.rb +0 -38
- data/spec/cucumber/tree/scenario_outline_spec.rb +0 -50
- data/spec/cucumber/tree/scenario_spec.rb +0 -134
- data/spec/cucumber/tree/step_outline_spec.rb +0 -17
- data/spec/cucumber/tree/step_spec.rb +0 -59
- data/spec/cucumber/treetop_parser/feature_parser_spec.rb +0 -120
@@ -9,6 +9,10 @@ Feature: Cucumber
|
|
9
9
|
Scenario: Call step from step
|
10
10
|
Given nested step is called
|
11
11
|
Then nested step should be executed
|
12
|
+
|
13
|
+
Scenario: Call step from step using text table
|
14
|
+
Given nested step is called using text table
|
15
|
+
Then nested step should be executed
|
12
16
|
|
13
17
|
Scenario: Reading a table
|
14
18
|
Given the following table
|
@@ -16,7 +20,7 @@ Feature: Cucumber
|
|
16
20
|
| Oslo | London |
|
17
21
|
Then I should be working in London
|
18
22
|
And I should be born in Oslo
|
19
|
-
And I
|
23
|
+
And I should see a multiline string like
|
20
24
|
"""
|
21
25
|
A string
|
22
26
|
that spans
|
@@ -0,0 +1,221 @@
|
|
1
|
+
Feature: backgrounds
|
2
|
+
In order to provide a context to my scenarios within a feature
|
3
|
+
As a feature editor
|
4
|
+
I want to write a background section in my features.
|
5
|
+
|
6
|
+
Scenario: run a specific scenario with a background
|
7
|
+
When I run cucumber -q features/background/passing_background.feature:9 --require features
|
8
|
+
Then it should pass with
|
9
|
+
"""
|
10
|
+
Feature: Passing background sample
|
11
|
+
|
12
|
+
Background:
|
13
|
+
Given '10' cukes
|
14
|
+
|
15
|
+
Scenario: another passing background
|
16
|
+
Then I should have '10' cukes
|
17
|
+
|
18
|
+
1 scenario
|
19
|
+
3 passed steps
|
20
|
+
|
21
|
+
"""
|
22
|
+
|
23
|
+
Scenario: run a feature with a background that passes
|
24
|
+
When I run cucumber -q features/background/passing_background.feature --require features
|
25
|
+
Then it should pass with
|
26
|
+
"""
|
27
|
+
Feature: Passing background sample
|
28
|
+
|
29
|
+
Background:
|
30
|
+
Given '10' cukes
|
31
|
+
|
32
|
+
Scenario: passing background
|
33
|
+
Then I should have '10' cukes
|
34
|
+
|
35
|
+
Scenario: another passing background
|
36
|
+
Then I should have '10' cukes
|
37
|
+
|
38
|
+
2 scenarios
|
39
|
+
4 passed steps
|
40
|
+
|
41
|
+
"""
|
42
|
+
|
43
|
+
Scenario: run a feature with scenario outlines that has a background that passes
|
44
|
+
When I run cucumber -q features/background/scenario_outline_passing_background.feature --require features
|
45
|
+
Then it should pass with
|
46
|
+
"""
|
47
|
+
Feature: Passing background with scenario outlines sample
|
48
|
+
|
49
|
+
Background:
|
50
|
+
Given '10' cukes
|
51
|
+
|
52
|
+
Scenario Outline: passing background
|
53
|
+
Then I should have '<count>' cukes
|
54
|
+
|
55
|
+
Examples:
|
56
|
+
| count |
|
57
|
+
| 10 |
|
58
|
+
|
59
|
+
Scenario Outline: another passing background
|
60
|
+
Then I should have '<count>' cukes
|
61
|
+
|
62
|
+
Examples:
|
63
|
+
| count |
|
64
|
+
| 10 |
|
65
|
+
|
66
|
+
2 scenarios
|
67
|
+
5 passed steps
|
68
|
+
|
69
|
+
"""
|
70
|
+
|
71
|
+
Scenario: run a feature with a background that fails
|
72
|
+
When I run cucumber -q features/background/failing_background.feature --require features
|
73
|
+
Then it should fail with
|
74
|
+
"""
|
75
|
+
Feature: Failing background sample
|
76
|
+
|
77
|
+
Background:
|
78
|
+
Given failing without a table
|
79
|
+
FAIL (RuntimeError)
|
80
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
81
|
+
./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
|
82
|
+
features/background/failing_background.feature:4:in `Given failing without a table'
|
83
|
+
And '10' cukes
|
84
|
+
|
85
|
+
Scenario: failing background
|
86
|
+
Then I should have '10' cukes
|
87
|
+
|
88
|
+
Scenario: another failing background
|
89
|
+
Then I should have '10' cukes
|
90
|
+
|
91
|
+
2 scenarios
|
92
|
+
1 failed step
|
93
|
+
5 skipped steps
|
94
|
+
|
95
|
+
"""
|
96
|
+
|
97
|
+
Scenario: run a feature with scenario outlines that has a background that fails
|
98
|
+
When I run cucumber -q features/background/scenario_outline_failing_background.feature --require features
|
99
|
+
Then it should fail with
|
100
|
+
"""
|
101
|
+
Feature: Failing background with scenario outlines sample
|
102
|
+
|
103
|
+
Background:
|
104
|
+
Given failing without a table
|
105
|
+
FAIL (RuntimeError)
|
106
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
107
|
+
./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
|
108
|
+
features/background/scenario_outline_failing_background.feature:4:in `Given failing without a table'
|
109
|
+
|
110
|
+
Scenario Outline: failing background
|
111
|
+
Then I should have '<count>' cukes
|
112
|
+
|
113
|
+
Examples:
|
114
|
+
| count |
|
115
|
+
| 10 |
|
116
|
+
|
117
|
+
Scenario Outline: another failing background
|
118
|
+
Then I should have '<count>' cukes
|
119
|
+
|
120
|
+
Examples:
|
121
|
+
| count |
|
122
|
+
| 10 |
|
123
|
+
|
124
|
+
2 scenarios
|
125
|
+
1 failed step
|
126
|
+
4 skipped steps
|
127
|
+
|
128
|
+
"""
|
129
|
+
|
130
|
+
Scenario: run a feature with a background that is pending
|
131
|
+
When I run cucumber -q features/background/pending_background.feature --require features
|
132
|
+
Then it should pass with
|
133
|
+
"""
|
134
|
+
Feature: Pending background sample
|
135
|
+
|
136
|
+
Background:
|
137
|
+
Given pending
|
138
|
+
|
139
|
+
Scenario: pending background
|
140
|
+
Then I should have '10' cukes
|
141
|
+
|
142
|
+
Scenario: another pending background
|
143
|
+
Then I should have '10' cukes
|
144
|
+
|
145
|
+
2 scenarios
|
146
|
+
2 skipped steps
|
147
|
+
2 undefined steps
|
148
|
+
|
149
|
+
"""
|
150
|
+
|
151
|
+
Scenario: background passes with first scenario but fails with second
|
152
|
+
When I run cucumber -q features/background/failing_background_after_success.feature --require features
|
153
|
+
Then it should fail with
|
154
|
+
"""
|
155
|
+
Feature: Failing background after previously successful background sample
|
156
|
+
|
157
|
+
Background:
|
158
|
+
Given passing without a table
|
159
|
+
And '10' global cukes
|
160
|
+
|
161
|
+
Scenario: passing background
|
162
|
+
Then I should have '10' global cukes
|
163
|
+
|
164
|
+
Scenario: failing background
|
165
|
+
And '10' global cukes
|
166
|
+
FAIL (RuntimeError)
|
167
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
168
|
+
./features/step_definitions/sample_steps.rb:37:in `/^'(.+)' global cukes$/'
|
169
|
+
features/background/failing_background_after_success.feature:5:in `And '10' global cukes'
|
170
|
+
Then I should have '10' global cukes
|
171
|
+
|
172
|
+
2 scenarios
|
173
|
+
1 failed step
|
174
|
+
1 skipped step
|
175
|
+
4 passed steps
|
176
|
+
|
177
|
+
"""
|
178
|
+
|
179
|
+
Scenario: background with multline args
|
180
|
+
When I run cucumber -q features/background/multiline_args_background.feature --require features
|
181
|
+
Then it should pass with
|
182
|
+
"""
|
183
|
+
Feature: Passing background with multiline args
|
184
|
+
|
185
|
+
Background:
|
186
|
+
Given table
|
187
|
+
| a | b |
|
188
|
+
| c | d |
|
189
|
+
And multiline string
|
190
|
+
\"\"\"
|
191
|
+
I'm a cucumber and I'm okay.
|
192
|
+
I sleep all night and I test all day
|
193
|
+
\"\"\"
|
194
|
+
|
195
|
+
Scenario: passing background
|
196
|
+
Then the table should be
|
197
|
+
| a | b |
|
198
|
+
| c | d |
|
199
|
+
Then the multiline string should be
|
200
|
+
\"\"\"
|
201
|
+
I'm a cucumber and I'm okay.
|
202
|
+
I sleep all night and I test all day
|
203
|
+
\"\"\"
|
204
|
+
|
205
|
+
Scenario: another passing background
|
206
|
+
Then the table should be
|
207
|
+
| a | b |
|
208
|
+
| c | d |
|
209
|
+
Then the multiline string should be
|
210
|
+
\"\"\"
|
211
|
+
I'm a cucumber and I'm okay.
|
212
|
+
I sleep all night and I test all day
|
213
|
+
\"\"\"
|
214
|
+
|
215
|
+
2 scenarios
|
216
|
+
8 passed steps
|
217
|
+
|
218
|
+
"""
|
219
|
+
|
220
|
+
@josephwilk
|
221
|
+
Scenario: run a scenario showing explicit background steps --explicit-background
|
@@ -1,99 +1,118 @@
|
|
1
1
|
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
5
|
Scenario: Run single scenario with missing step definition
|
6
|
-
When I run cucumber -q features/sample.feature:
|
7
|
-
Then it should pass with
|
6
|
+
When I run cucumber -q features/sample.feature:5
|
7
|
+
Then it should pass with
|
8
8
|
"""
|
9
|
+
@one
|
9
10
|
Feature: Sample
|
11
|
+
|
12
|
+
@two @three
|
10
13
|
Scenario: Missing
|
11
14
|
Given missing
|
12
15
|
|
13
|
-
|
14
16
|
1 scenario
|
15
|
-
1
|
16
|
-
|
17
|
+
1 undefined step
|
18
|
+
|
17
19
|
"""
|
18
|
-
|
19
|
-
Scenario:
|
20
|
-
When I run cucumber -q features/sample.feature:
|
20
|
+
|
21
|
+
Scenario: Fail with --strict
|
22
|
+
When I run cucumber -q features/sample.feature:5 --strict
|
21
23
|
Then it should fail with
|
22
24
|
"""
|
25
|
+
@one
|
23
26
|
Feature: Sample
|
24
|
-
Scenario: Failing
|
25
|
-
Given failing
|
26
|
-
FAIL (RuntimeError)
|
27
|
-
./features/step_definitions/sample_steps.rb:5:in `Given /^failing$/'
|
28
|
-
features/sample.feature:12:in `Given failing'
|
29
27
|
|
28
|
+
@two @three
|
29
|
+
Scenario: Missing
|
30
|
+
Given missing
|
31
|
+
Undefined step: "missing" (Cucumber::Undefined)
|
32
|
+
features/sample.feature:6:in `Given missing'
|
30
33
|
|
31
34
|
1 scenario
|
32
|
-
1 step
|
35
|
+
1 undefined step
|
33
36
|
|
34
37
|
"""
|
35
38
|
|
36
|
-
Scenario:
|
37
|
-
When I run cucumber -q features/sample.feature:
|
39
|
+
Scenario: Succeed with --strict
|
40
|
+
When I run cucumber -q features/sample.feature:9 --strict
|
41
|
+
Then it should pass with
|
42
|
+
"""
|
43
|
+
@one
|
44
|
+
Feature: Sample
|
45
|
+
|
46
|
+
@three
|
47
|
+
Scenario: Passing
|
48
|
+
Given passing
|
49
|
+
| a | b |
|
50
|
+
| c | d |
|
51
|
+
|
52
|
+
1 scenario
|
53
|
+
1 passed step
|
54
|
+
|
55
|
+
"""
|
56
|
+
|
57
|
+
Scenario: Specify 2 line numbers where one is a tag
|
58
|
+
When I run cucumber -q features/sample.feature:5:14
|
38
59
|
Then it should fail with
|
39
60
|
"""
|
61
|
+
@one
|
40
62
|
Feature: Sample
|
63
|
+
|
64
|
+
@two @three
|
41
65
|
Scenario: Missing
|
42
66
|
Given missing
|
43
67
|
|
68
|
+
@four
|
44
69
|
Scenario: Failing
|
45
70
|
Given failing
|
71
|
+
\"\"\"
|
72
|
+
hello
|
73
|
+
\"\"\"
|
46
74
|
FAIL (RuntimeError)
|
47
|
-
./features/step_definitions/sample_steps.rb:
|
48
|
-
features/
|
49
|
-
|
75
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
76
|
+
./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
|
77
|
+
features/sample.feature:16:in `Given failing'
|
50
78
|
|
51
79
|
2 scenarios
|
52
|
-
1 step
|
53
|
-
1
|
80
|
+
1 failed step
|
81
|
+
1 undefined step
|
54
82
|
|
55
83
|
"""
|
56
84
|
|
57
|
-
|
58
85
|
Scenario: Require missing step definition from elsewhere
|
59
|
-
When I run cucumber -q -r ../../features/step_definitions/extra_steps.rb features/sample.feature:
|
86
|
+
When I run cucumber -q -r ../../features/step_definitions/extra_steps.rb features/sample.feature:5
|
60
87
|
Then it should pass with
|
61
88
|
"""
|
89
|
+
@one
|
62
90
|
Feature: Sample
|
91
|
+
|
92
|
+
@two @three
|
63
93
|
Scenario: Missing
|
64
94
|
Given missing
|
65
95
|
|
66
|
-
|
67
96
|
1 scenario
|
68
|
-
1 step
|
69
|
-
|
70
|
-
"""
|
71
|
-
|
72
|
-
Scenario: Specify the line number of a blank line
|
73
|
-
When I run cucumber -q features/sample.feature:10
|
74
|
-
Then it should pass with
|
75
|
-
"""
|
76
|
-
Feature: Sample
|
77
|
-
Scenario: Passing
|
78
|
-
Given passing
|
79
|
-
|
80
|
-
|
81
|
-
1 scenario
|
82
|
-
1 step passed
|
97
|
+
1 passed step
|
83
98
|
|
84
99
|
"""
|
85
100
|
|
86
101
|
Scenario: Specify the line number of a row
|
87
|
-
When I run cucumber -q features/sample.feature:
|
102
|
+
When I run cucumber -q features/sample.feature:12
|
88
103
|
Then it should pass with
|
89
104
|
"""
|
105
|
+
@one
|
90
106
|
Feature: Sample
|
107
|
+
|
108
|
+
@three
|
91
109
|
Scenario: Passing
|
92
110
|
Given passing
|
93
|
-
|
111
|
+
| a | b |
|
112
|
+
| c | d |
|
94
113
|
|
95
114
|
1 scenario
|
96
|
-
1 step
|
115
|
+
1 passed step
|
97
116
|
|
98
117
|
"""
|
99
118
|
|
@@ -101,19 +120,19 @@ Feature: Cucumber command line
|
|
101
120
|
When I run cucumber -q --format progress features/sample.feature
|
102
121
|
Then it should fail with
|
103
122
|
"""
|
104
|
-
|
123
|
+
U.F
|
105
124
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
125
|
+
(::) failed steps (::)
|
126
|
+
|
127
|
+
FAIL (RuntimeError)
|
128
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
129
|
+
./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
|
130
|
+
features/sample.feature:16:in `Given failing'
|
131
|
+
|
132
|
+
3 scenarios
|
133
|
+
1 failed step
|
134
|
+
1 undefined step
|
135
|
+
1 passed step
|
117
136
|
|
118
137
|
"""
|
119
138
|
|
@@ -126,12 +145,14 @@ Feature: Cucumber command line
|
|
126
145
|
For å slippe å gjøre dumme feil
|
127
146
|
Som en regnskapsfører
|
128
147
|
Vil jeg kunne legge sammen
|
148
|
+
|
129
149
|
Scenario: to tall
|
130
150
|
Gitt at jeg har tastet inn 5
|
131
151
|
Og at jeg har tastet inn 7
|
132
152
|
Når jeg summerer
|
133
153
|
Så skal resultatet være 12
|
134
154
|
|
155
|
+
@iterasjon3
|
135
156
|
Scenario: tre tall
|
136
157
|
Gitt at jeg har tastet inn 5
|
137
158
|
Og at jeg har tastet inn 7
|
@@ -139,85 +160,230 @@ Feature: Cucumber command line
|
|
139
160
|
Når jeg summerer
|
140
161
|
Så skal resultatet være 13
|
141
162
|
|
142
|
-
|
143
163
|
2 scenarios
|
144
|
-
9 steps
|
164
|
+
9 passed steps
|
145
165
|
|
146
166
|
"""
|
147
167
|
|
148
168
|
Scenario: --dry-run
|
149
|
-
When I run cucumber --dry-run features
|
169
|
+
When I run cucumber --dry-run --no-snippets features/*.feature
|
150
170
|
Then it should pass with
|
151
171
|
"""
|
152
|
-
Feature:
|
153
|
-
|
154
|
-
|
172
|
+
Feature: Calling undefined step
|
173
|
+
|
174
|
+
Scenario: Call directly
|
175
|
+
Given a step definition that calls an undefined step
|
176
|
+
|
177
|
+
Scenario: Call via another
|
178
|
+
Given call step "a step definition that calls an undefined step"
|
179
|
+
|
180
|
+
Feature: Failing expectation
|
181
|
+
|
182
|
+
Scenario: Failing expectation
|
183
|
+
Given failing expectation
|
184
|
+
|
185
|
+
Feature: Lots of undefined
|
186
|
+
|
187
|
+
Scenario: Implement me
|
188
|
+
Given it snows in Sahara
|
189
|
+
Given it's 40 degrees in Norway
|
190
|
+
And it's 40 degrees in Norway
|
191
|
+
When I stop procrastinating
|
192
|
+
And there is world peace
|
193
|
+
|
194
|
+
Feature: Outline Sample
|
155
195
|
|
156
|
-
|
157
|
-
|missing|
|
158
|
-
|passing|
|
159
|
-
|failing|
|
196
|
+
Scenario: I have no steps
|
160
197
|
|
161
|
-
|
198
|
+
Scenario Outline: Test state
|
199
|
+
Given <state> without a table
|
200
|
+
Given <other_state> without a table
|
162
201
|
|
163
|
-
|
164
|
-
|
202
|
+
Examples: Rainbow colours
|
203
|
+
| state | other_state |
|
204
|
+
| missing | passing |
|
205
|
+
| passing | passing |
|
206
|
+
| failing | passing |
|
165
207
|
|
166
|
-
|
167
|
-
|
208
|
+
Examples: Only passing
|
209
|
+
| state | other_state |
|
210
|
+
| passing | passing |
|
168
211
|
|
169
|
-
|
170
|
-
|
212
|
+
@one
|
213
|
+
Feature: Sample
|
214
|
+
|
215
|
+
@two @three
|
216
|
+
Scenario: Missing
|
217
|
+
Given missing
|
171
218
|
|
219
|
+
@three
|
220
|
+
Scenario: Passing
|
221
|
+
Given passing
|
222
|
+
| a | b |
|
223
|
+
| c | d |
|
172
224
|
|
173
|
-
|
174
|
-
|
225
|
+
@four
|
226
|
+
Scenario: Failing
|
227
|
+
Given failing
|
228
|
+
\"\"\"
|
229
|
+
hello
|
230
|
+
\"\"\"
|
231
|
+
|
232
|
+
12 scenarios
|
233
|
+
12 skipped steps
|
234
|
+
7 undefined steps
|
175
235
|
|
176
236
|
"""
|
177
237
|
|
178
238
|
Scenario: Multiple formatters and outputs
|
179
|
-
When I run cucumber --format progress --out tmp/progress.txt --format
|
180
|
-
|
239
|
+
When I run cucumber --format progress --out tmp/progress.txt --format pretty --out tmp/pretty.txt --dry-run features/lots_of_undefined.feature
|
240
|
+
And examples/self_test/tmp/progress.txt should contain
|
181
241
|
"""
|
242
|
+
UUUUU
|
243
|
+
|
244
|
+
1 scenario
|
245
|
+
5 undefined steps
|
246
|
+
|
182
247
|
"""
|
183
|
-
And examples/self_test/tmp/
|
248
|
+
And examples/self_test/tmp/pretty.txt should match
|
184
249
|
"""
|
185
|
-
|
250
|
+
Feature: Lots of undefined
|
186
251
|
|
187
|
-
|
252
|
+
Scenario: Implement me
|
253
|
+
Given it snows in Sahara
|
254
|
+
Given it's 40 degrees in Norway
|
255
|
+
And it's 40 degrees in Norway
|
256
|
+
When I stop procrastinating
|
257
|
+
And there is world peace
|
188
258
|
|
189
|
-
1
|
190
|
-
|
259
|
+
1 scenario
|
260
|
+
5 undefined steps
|
191
261
|
|
262
|
+
"""
|
192
263
|
|
193
|
-
|
264
|
+
Scenario: Run scenario specified by name using --scenario
|
265
|
+
When I run cucumber --scenario Passing -q features
|
266
|
+
Then it should pass with
|
267
|
+
"""
|
268
|
+
@one
|
269
|
+
Feature: Sample
|
194
270
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
271
|
+
@three
|
272
|
+
Scenario: Passing
|
273
|
+
Given passing
|
274
|
+
| a | b |
|
275
|
+
| c | d |
|
199
276
|
|
200
|
-
|
201
|
-
|
202
|
-
./features/step_definitions/sample_steps.rb:5:in `Given /^failing$/'
|
203
|
-
features/sample.feature:12:in `Given failing'
|
277
|
+
1 scenario
|
278
|
+
1 passed step
|
204
279
|
|
205
280
|
"""
|
206
|
-
|
281
|
+
|
282
|
+
Scenario: Run with a tag that exists on 2 scenarios
|
283
|
+
When I run cucumber -q features --tags three
|
284
|
+
Then it should pass with
|
207
285
|
"""
|
208
|
-
|
286
|
+
@one
|
287
|
+
Feature: Sample
|
288
|
+
|
289
|
+
@two @three
|
290
|
+
Scenario: Missing
|
291
|
+
Given missing
|
292
|
+
|
293
|
+
@three
|
294
|
+
Scenario: Passing
|
295
|
+
Given passing
|
296
|
+
| a | b |
|
297
|
+
| c | d |
|
298
|
+
|
299
|
+
2 scenarios
|
300
|
+
1 undefined step
|
301
|
+
1 passed step
|
302
|
+
|
209
303
|
"""
|
210
|
-
|
211
|
-
Scenario: Run
|
212
|
-
When I run cucumber
|
304
|
+
|
305
|
+
Scenario: Run with a tag that exists on 1 feature
|
306
|
+
When I run cucumber -q features --tags one
|
307
|
+
Then it should fail with
|
308
|
+
"""
|
309
|
+
@one
|
310
|
+
Feature: Sample
|
311
|
+
|
312
|
+
@two @three
|
313
|
+
Scenario: Missing
|
314
|
+
Given missing
|
315
|
+
|
316
|
+
@three
|
317
|
+
Scenario: Passing
|
318
|
+
Given passing
|
319
|
+
| a | b |
|
320
|
+
| c | d |
|
321
|
+
|
322
|
+
@four
|
323
|
+
Scenario: Failing
|
324
|
+
Given failing
|
325
|
+
\"\"\"
|
326
|
+
hello
|
327
|
+
\"\"\"
|
328
|
+
FAIL (RuntimeError)
|
329
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
330
|
+
./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
|
331
|
+
features/sample.feature:16:in `Given failing'
|
332
|
+
|
333
|
+
3 scenarios
|
334
|
+
1 failed step
|
335
|
+
1 undefined step
|
336
|
+
1 passed step
|
337
|
+
|
338
|
+
"""
|
339
|
+
|
340
|
+
Scenario: Run with a negative tag
|
341
|
+
When I run cucumber -q features/sample.feature --dry-run -t ~four
|
213
342
|
Then it should pass with
|
214
343
|
"""
|
344
|
+
@one
|
215
345
|
Feature: Sample
|
346
|
+
|
347
|
+
@two @three
|
348
|
+
Scenario: Missing
|
349
|
+
Given missing
|
350
|
+
|
351
|
+
@three
|
216
352
|
Scenario: Passing
|
217
353
|
Given passing
|
354
|
+
| a | b |
|
355
|
+
| c | d |
|
218
356
|
|
357
|
+
2 scenarios
|
358
|
+
1 skipped step
|
359
|
+
1 undefined step
|
219
360
|
|
220
|
-
|
221
|
-
1 step passed
|
361
|
+
"""
|
222
362
|
|
363
|
+
Scenario: Reformat files with --autoformat
|
364
|
+
When I run cucumber --autoformat tmp/formatted features
|
365
|
+
Then examples/self_test/tmp/formatted/features/sample.feature should contain
|
223
366
|
"""
|
367
|
+
@one
|
368
|
+
Feature: Sample
|
369
|
+
|
370
|
+
@two @three
|
371
|
+
Scenario: Missing
|
372
|
+
Given missing
|
373
|
+
|
374
|
+
@three
|
375
|
+
Scenario: Passing
|
376
|
+
Given passing
|
377
|
+
| a | b |
|
378
|
+
| c | d |
|
379
|
+
|
380
|
+
@four
|
381
|
+
Scenario: Failing
|
382
|
+
Given failing
|
383
|
+
\"\"\"
|
384
|
+
hello
|
385
|
+
\"\"\"
|
386
|
+
|
387
|
+
|
388
|
+
"""
|
389
|
+
|