cucumber 3.0.0.pre.1 → 3.0.0.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.cucumberproignore +6 -0
- data/.rubocop.yml +13 -0
- data/.rubocop_todo.yml +1075 -0
- data/.travis.yml +42 -8
- data/CONTRIBUTING.md +8 -1
- data/Gemfile +16 -10
- data/History.md +96 -36
- data/README.md +12 -3
- data/Rakefile +12 -2
- data/appveyor.yml +26 -0
- data/cucumber.gemspec +15 -10
- data/cucumber.yml +9 -10
- data/examples/i18n/Rakefile +1 -1
- data/examples/i18n/ar/features/step_definitions/calculator_steps.rb +2 -2
- data/examples/i18n/ar/lib/calculator.rb +2 -2
- data/examples/i18n/bg/features/step_definitions/calculator_steps.rb +6 -6
- data/examples/i18n/ca/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/ca/lib/calculadora.rb +2 -2
- data/examples/i18n/cs/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/cs/lib/calculator.rb +3 -3
- data/examples/i18n/da/features/step_definitions/lommeregner_steps.rb +4 -4
- data/examples/i18n/da/lib/lommeregner.rb +2 -2
- data/examples/i18n/de/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/de/lib/calculator.rb +2 -2
- data/examples/i18n/el/features/step_definitions/calculator_steps.rb +5 -5
- data/examples/i18n/el/lib/calculator.rb +2 -2
- data/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb +4 -4
- data/examples/i18n/en-lol/lib/basket.rb +2 -2
- data/examples/i18n/en-lol/lib/belly.rb +2 -2
- data/examples/i18n/en/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/en/lib/calculator.rb +2 -2
- data/examples/i18n/eo/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/eo/lib/calculator.rb +2 -2
- data/examples/i18n/es/features/step_definitions/calculador_steps.rb +5 -5
- data/examples/i18n/es/lib/calculador.rb +2 -2
- data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +4 -4
- data/examples/i18n/et/lib/kalkulaator.rb +3 -3
- data/examples/i18n/fi/features/step_definitions/laskin_steps.rb +3 -3
- data/examples/i18n/fi/lib/laskin.rb +1 -1
- data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +8 -8
- data/examples/i18n/fr/features/support/env.rb +1 -1
- data/examples/i18n/fr/lib/calculatrice.rb +2 -2
- data/examples/i18n/he/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/he/lib/calculator.rb +1 -1
- data/examples/i18n/hi/features/step_definitions/calculator_steps.rb +3 -3
- data/examples/i18n/hi/lib/calculator.rb +1 -1
- data/examples/i18n/ht/features/step_definitions/kalkilatris_steps.rb +4 -4
- data/examples/i18n/ht/lib/kalkilatris.rb +2 -2
- data/examples/i18n/hu/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/hu/lib/calculator.rb +1 -1
- data/examples/i18n/id/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/id/lib/calculator.rb +2 -2
- data/examples/i18n/it/features/step_definitions/calcolatrice_steps.rb +4 -4
- data/examples/i18n/it/lib/calcolatrice.rb +3 -3
- data/examples/i18n/ja/features/step_definitions/calculator_steps.rb +3 -3
- data/examples/i18n/ja/features/support/env.rb +1 -1
- data/examples/i18n/ja/lib/calculator.rb +2 -2
- data/examples/i18n/ko/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/ko/lib/calculator.rb +2 -2
- data/examples/i18n/lt/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/lt/lib/calculator.rb +2 -2
- data/examples/i18n/lv/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/lv/lib/calculator.rb +2 -2
- data/examples/i18n/no/features/step_definitions/kalkulator_steps.rb +3 -3
- data/examples/i18n/no/features/support/env.rb +1 -1
- data/examples/i18n/no/lib/kalkulator.rb +2 -2
- data/examples/i18n/pl/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/pl/lib/calculator.rb +2 -2
- data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +3 -3
- data/examples/i18n/pt/features/support/env.rb +1 -1
- data/examples/i18n/pt/lib/calculadora.rb +1 -1
- data/examples/i18n/ro/features/step_definitions/calculator_steps.rb +5 -5
- data/examples/i18n/ro/lib/calculator.rb +1 -1
- data/examples/i18n/ru/features/step_definitions/calculator_steps.rb +5 -5
- data/examples/i18n/sk/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/sk/lib/calculator.rb +2 -2
- data/examples/i18n/sr-Cyrl/features/step_definitions/calculator_steps.rb +3 -3
- data/examples/i18n/sr-Cyrl/features/support/env.rb +1 -1
- data/examples/i18n/sr-Cyrl/lib/calculator.rb +2 -2
- data/examples/i18n/sr-Latn/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/sr-Latn/lib/calculator.rb +2 -2
- data/examples/i18n/sv/features/step_definitions/kalkulator_steps.rb +3 -3
- data/examples/i18n/sv/lib/kalkulator.rb +2 -2
- data/examples/i18n/tr/features/step_definitions/hesap_makinesi_adimlari.rb +4 -4
- data/examples/i18n/tr/lib/hesap_makinesi.rb +2 -2
- data/examples/i18n/uk/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/uz/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/zh-CN/features/step_definitions/calculator_steps.rb +5 -5
- data/examples/i18n/zh-CN/lib/calculator.rb +2 -2
- data/examples/i18n/zh-TW/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/zh-TW/lib/calculator.rb +2 -2
- data/examples/rspec_doubles/features/step_definitions/calvin_steps.rb +3 -3
- data/examples/sinatra/features/step_definitions/add_steps.rb +4 -4
- data/examples/tcl/features/step_definitions/fib_steps.rb +2 -2
- data/examples/test_unit/features/step_definitions/test_unit_steps.rb +4 -4
- data/examples/watir/features/step_definitions/search_steps.rb +3 -3
- data/examples/watir/features/support/screenshots.rb +5 -5
- data/features/docs/api/list_step_defs_as_json.feature +21 -7
- data/features/docs/api/listen_for_events.feature +1 -1
- data/features/docs/api/run_cli_main_with_existing_runtime.feature +1 -0
- data/features/docs/cli/dry_run.feature +3 -0
- data/features/docs/cli/execute_with_tag_filter.feature +4 -4
- data/features/docs/cli/fail_fast.feature +2 -0
- data/features/docs/{gherkin/language_help.feature → cli/i18n.feature} +6 -6
- data/features/docs/cli/randomize.feature +2 -2
- data/features/docs/cli/retry_failing_tests.feature +28 -3
- data/features/docs/cli/run_scenarios_matching_name.feature +1 -0
- data/features/docs/cli/specifying_multiple_formatters.feature +3 -0
- data/features/docs/cli/strict_mode.feature +6 -0
- data/features/docs/defining_steps/nested_steps.feature +5 -1
- data/features/docs/defining_steps/nested_steps_i18n.feature +1 -0
- data/features/docs/defining_steps/nested_steps_with_second_arg.feature +2 -0
- data/features/docs/defining_steps/printing_messages.feature +1 -1
- data/features/docs/defining_steps/skip_scenario.feature +1 -0
- data/features/docs/defining_steps/snippets.feature +18 -18
- data/features/docs/events/gherkin_source_read_event.feature +43 -0
- data/features/docs/events/step_activated_event.feature +36 -0
- data/features/docs/events/step_definition_registered_event.feature +29 -0
- data/features/docs/events/test_case_finished_event.feature +35 -0
- data/features/docs/events/test_case_starting_event.feature +54 -0
- data/features/docs/events/test_run_finished_event.feature +40 -0
- data/features/docs/events/test_run_starting_event.feature +41 -0
- data/features/docs/events/test_step_finished_event.feature +47 -0
- data/features/docs/events/test_step_starting_event.feature +43 -0
- data/features/docs/exception_in_after_hook.feature +3 -2
- data/features/docs/exception_in_after_step_hook.feature +2 -0
- data/features/docs/exception_in_around_hook.feature +2 -0
- data/features/docs/exception_in_before_hook.feature +3 -1
- data/features/docs/extending_cucumber/custom_formatter.feature +21 -1
- data/features/docs/formatters/json_formatter.feature +4 -4
- data/features/docs/formatters/junit_formatter.feature +7 -6
- data/features/docs/formatters/pretty_formatter.feature +1 -0
- data/features/docs/formatters/progress_formatter.feature +1 -0
- data/features/docs/formatters/rerun_formatter.feature +2 -0
- data/features/docs/formatters/summary_formatter.feature +1 -0
- data/features/docs/formatters/usage_formatter.feature +3 -0
- data/features/docs/getting_started.feature +2 -1
- data/features/docs/gherkin/background.feature +5 -5
- data/features/docs/gherkin/doc_strings.feature +2 -0
- data/features/docs/gherkin/expand_option_for_outlines.feature +1 -0
- data/features/docs/gherkin/outlines.feature +4 -0
- data/features/docs/gherkin/unicode_table.feature +1 -0
- data/features/docs/gherkin/using_descriptions.feature +1 -0
- data/features/docs/gherkin/using_star_notation.feature +1 -1
- data/features/docs/post_configuration_hook.feature +1 -1
- data/features/docs/rake_task.feature +5 -0
- data/features/docs/raketask.feature +3 -1
- data/features/docs/work_in_progress.feature +5 -2
- data/features/docs/writing_support_code/after_step_hooks.feature +3 -1
- data/features/docs/writing_support_code/around_hooks.feature +6 -0
- data/features/docs/writing_support_code/before_hook.feature +1 -0
- data/features/docs/writing_support_code/hook_order.feature +3 -1
- data/features/docs/writing_support_code/parameter_types.feature +75 -0
- data/features/docs/writing_support_code/tagged_hooks.feature +1 -1
- data/features/lib/step_definitions/aruba_steps.rb +4 -10
- data/features/lib/step_definitions/cli_steps.rb +2 -2
- data/features/lib/step_definitions/cucumber_steps.rb +8 -12
- data/features/lib/step_definitions/iso-8859-1_steps.rb +2 -2
- data/features/lib/step_definitions/json_steps.rb +1 -1
- data/features/lib/step_definitions/junit_steps.rb +1 -1
- data/features/lib/step_definitions/language_steps.rb +2 -2
- data/features/lib/step_definitions/profile_steps.rb +6 -6
- data/features/lib/step_definitions/retry_steps.rb +3 -3
- data/features/lib/step_definitions/ruby_steps.rb +1 -1
- data/features/lib/support/env.rb +1 -1
- data/features/lib/support/fake_wire_server.rb +7 -2
- data/features/lib/support/feature_factory.rb +1 -1
- data/features/lib/support/normalise_output.rb +13 -12
- data/features/lib/support/parameter_types.rb +8 -0
- data/gem_tasks/contributors.rake +9 -6
- data/gem_tasks/environment.rake +1 -5
- data/gem_tasks/examples.rake +1 -1
- data/gem_tasks/fix_cr_lf.rake +1 -1
- data/gem_tasks/flog.rake +2 -2
- data/gem_tasks/rspec.rake +1 -1
- data/lib/autotest/cucumber_mixin.rb +15 -15
- data/lib/autotest/discover.rb +2 -2
- data/lib/cucumber/cli/configuration.rb +7 -13
- data/lib/cucumber/cli/main.rb +6 -6
- data/lib/cucumber/cli/options.rb +163 -126
- data/lib/cucumber/cli/profile_loader.rb +24 -20
- data/lib/cucumber/configuration.rb +12 -17
- data/lib/cucumber/constantize.rb +1 -1
- data/lib/cucumber/core_ext/string.rb +1 -1
- data/lib/cucumber/deprecate.rb +1 -1
- data/lib/cucumber/events.rb +11 -1
- data/lib/cucumber/events/gherkin_source_read.rb +17 -0
- data/lib/cucumber/events/{step_match.rb → step_activated.rb} +2 -2
- data/lib/cucumber/events/step_definition_registered.rb +1 -1
- data/lib/cucumber/events/test_case_finished.rb +18 -0
- data/lib/cucumber/events/test_case_starting.rb +15 -0
- data/lib/cucumber/events/test_run_starting.rb +16 -0
- data/lib/cucumber/events/test_step_finished.rb +20 -0
- data/lib/cucumber/events/test_step_starting.rb +17 -0
- data/lib/cucumber/filters.rb +1 -0
- data/lib/cucumber/filters/activate_steps.rb +1 -1
- data/lib/cucumber/filters/broadcast_test_run_starting_event.rb +27 -0
- data/lib/cucumber/filters/retry.rb +1 -1
- data/lib/cucumber/filters/tag_limits.rb +3 -3
- data/lib/cucumber/filters/tag_limits/verifier.rb +1 -1
- data/lib/cucumber/formatter/ansicolor.rb +8 -11
- data/lib/cucumber/formatter/backtrace_filter.rb +19 -7
- data/lib/cucumber/formatter/console.rb +16 -19
- data/lib/cucumber/formatter/console_counts.rb +8 -21
- data/lib/cucumber/formatter/console_issues.rb +30 -9
- data/lib/cucumber/formatter/duration.rb +1 -1
- data/lib/cucumber/formatter/fail_fast.rb +1 -1
- data/lib/cucumber/formatter/html.rb +168 -242
- data/lib/cucumber/formatter/html_builder.rb +110 -0
- data/lib/cucumber/formatter/inline-js.js +30 -0
- data/lib/cucumber/formatter/interceptor.rb +2 -2
- data/lib/cucumber/formatter/json.rb +12 -12
- data/lib/cucumber/formatter/junit.rb +11 -11
- data/lib/cucumber/formatter/legacy_api/adapter.rb +27 -27
- data/lib/cucumber/formatter/legacy_api/ast.rb +16 -20
- data/lib/cucumber/formatter/legacy_api/results.rb +6 -8
- data/lib/cucumber/formatter/pretty.rb +17 -17
- data/lib/cucumber/formatter/progress.rb +11 -12
- data/lib/cucumber/formatter/rerun.rb +1 -1
- data/lib/cucumber/formatter/steps.rb +1 -1
- data/lib/cucumber/formatter/unicode.rb +1 -1
- data/lib/cucumber/formatter/usage.rb +12 -12
- data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +1 -1
- data/lib/cucumber/gherkin/formatter/escaping.rb +1 -1
- data/lib/cucumber/{rb_support/rb_dsl.rb → glue/dsl.rb} +44 -17
- data/lib/cucumber/glue/hook.rb +43 -0
- data/lib/cucumber/glue/invoke_in_world.rb +70 -0
- data/lib/cucumber/glue/proto_world.rb +225 -0
- data/lib/cucumber/{rb_support/rb_language.rb → glue/registry_and_more.rb} +45 -86
- data/lib/cucumber/{rb_support → glue}/snippet.rb +62 -25
- data/lib/cucumber/glue/step_definition.rb +143 -0
- data/lib/cucumber/glue/world_factory.rb +23 -0
- data/lib/cucumber/hooks.rb +4 -4
- data/lib/cucumber/multiline_argument.rb +2 -2
- data/lib/cucumber/multiline_argument/data_table.rb +40 -178
- data/lib/cucumber/multiline_argument/data_table/diff_matrices.rb +158 -0
- data/lib/cucumber/platform.rb +3 -5
- data/lib/cucumber/rake/task.rb +11 -11
- data/lib/cucumber/rspec/disable_option_parser.rb +1 -1
- data/lib/cucumber/rspec/doubles.rb +1 -1
- data/lib/cucumber/running_test_case.rb +2 -2
- data/lib/cucumber/runtime.rb +46 -34
- data/lib/cucumber/runtime/after_hooks.rb +1 -1
- data/lib/cucumber/runtime/for_programming_languages.rb +1 -36
- data/lib/cucumber/runtime/support_code.rb +19 -15
- data/lib/cucumber/runtime/user_interface.rb +4 -11
- data/lib/cucumber/step_argument.rb +0 -2
- data/lib/cucumber/step_definition_light.rb +1 -0
- data/lib/cucumber/step_match.rb +16 -15
- data/lib/cucumber/step_match_search.rb +2 -3
- data/lib/cucumber/term/ansicolor.rb +1 -1
- data/lib/cucumber/version +1 -1
- data/lib/simplecov_setup.rb +1 -1
- data/scripts/invite-collaborator +40 -0
- data/scripts/update-history +83 -0
- data/spec/cucumber/cli/configuration_spec.rb +95 -97
- data/spec/cucumber/cli/main_spec.rb +7 -7
- data/spec/cucumber/cli/options_spec.rb +112 -78
- data/spec/cucumber/cli/profile_loader_spec.rb +24 -5
- data/spec/cucumber/cli/rerun_spec.rb +20 -20
- data/spec/cucumber/configuration_spec.rb +47 -47
- data/spec/cucumber/constantize_spec.rb +2 -2
- data/spec/cucumber/events_spec.rb +9 -0
- data/spec/cucumber/file_specs_spec.rb +25 -25
- data/spec/cucumber/filters/activate_steps_spec.rb +16 -16
- data/spec/cucumber/filters/gated_receiver_spec.rb +6 -6
- data/spec/cucumber/filters/retry_spec.rb +22 -9
- data/spec/cucumber/filters/tag_limits/test_case_index_spec.rb +11 -11
- data/spec/cucumber/filters/tag_limits/verifier_spec.rb +14 -14
- data/spec/cucumber/filters/tag_limits_spec.rb +8 -8
- data/spec/cucumber/formatter/ansicolor_spec.rb +9 -9
- data/spec/cucumber/formatter/backtrace_filter_spec.rb +32 -0
- data/spec/cucumber/formatter/console_counts_spec.rb +1 -1
- data/spec/cucumber/formatter/duration_spec.rb +3 -3
- data/spec/cucumber/formatter/fail_fast_spec.rb +21 -21
- data/spec/cucumber/formatter/html_spec.rb +58 -58
- data/spec/cucumber/formatter/json_spec.rb +44 -46
- data/spec/cucumber/formatter/junit_spec.rb +43 -45
- data/spec/cucumber/formatter/legacy_api/adapter_spec.rb +43 -43
- data/spec/cucumber/formatter/pretty_spec.rb +107 -107
- data/spec/cucumber/formatter/progress_spec.rb +20 -20
- data/spec/cucumber/formatter/rerun_spec.rb +1 -1
- data/spec/cucumber/formatter/spec_helper.rb +6 -5
- data/spec/cucumber/{rb_support/rb_world_spec.rb → glue/proto_world_spec.rb} +20 -5
- data/spec/cucumber/glue/registry_and_more_spec.rb +213 -0
- data/spec/cucumber/{rb_support → glue}/snippet_spec.rb +61 -25
- data/spec/cucumber/glue/step_definition_spec.rb +207 -0
- data/spec/cucumber/hooks_spec.rb +3 -3
- data/spec/cucumber/multiline_argument/data_table_spec.rb +177 -133
- data/spec/cucumber/project_initializer_spec.rb +10 -10
- data/spec/cucumber/rake/forked_spec.rb +10 -10
- data/spec/cucumber/rake/task_spec.rb +20 -20
- data/spec/cucumber/running_test_case_spec.rb +35 -35
- data/spec/cucumber/runtime/for_programming_languages_spec.rb +1 -30
- data/spec/cucumber/runtime_spec.rb +2 -2
- data/spec/cucumber/step_argument_spec.rb +5 -5
- data/spec/cucumber/step_match_search_spec.rb +31 -41
- data/spec/cucumber/step_match_spec.rb +33 -33
- data/spec/cucumber/world/pending_spec.rb +10 -10
- metadata +117 -47
- data/features/docs/formatters/debug_formatter.feature +0 -47
- data/features/docs/writing_support_code/transforms.feature +0 -98
- data/features/lib/step_definitions/wire_steps.rb +0 -59
- data/gem_tasks/cucumber.rake +0 -26
- data/lib/cucumber/core_ext/instance_exec.rb +0 -71
- data/lib/cucumber/formatter/debug.rb +0 -36
- data/lib/cucumber/rb_support/rb_hook.rb +0 -20
- data/lib/cucumber/rb_support/rb_step_definition.rb +0 -132
- data/lib/cucumber/rb_support/rb_transform.rb +0 -60
- data/lib/cucumber/rb_support/rb_world.rb +0 -171
- data/spec/cucumber/core_ext/instance_exec_spec.rb +0 -5
- data/spec/cucumber/formatter/debug_spec.rb +0 -65
- data/spec/cucumber/rb_support/rb_language_spec.rb +0 -321
- data/spec/cucumber/rb_support/rb_step_definition_spec.rb +0 -200
- data/spec/cucumber/rb_support/rb_transform_spec.rb +0 -47
@@ -18,6 +18,7 @@ Feature: Rerun formatter
|
|
18
18
|
Background:
|
19
19
|
Given the standard step definitions
|
20
20
|
|
21
|
+
@todo-windows
|
21
22
|
Scenario: Exit code is zero
|
22
23
|
Given a file named "features/mixed.feature" with:
|
23
24
|
"""
|
@@ -70,6 +71,7 @@ Feature: Rerun formatter
|
|
70
71
|
"""
|
71
72
|
"""
|
72
73
|
|
74
|
+
@todo-windows
|
73
75
|
Scenario: Exit code is not zero, regular scenario
|
74
76
|
Given a file named "features/mixed.feature" with:
|
75
77
|
"""
|
@@ -30,6 +30,7 @@ Feature: Usage formatter
|
|
30
30
|
Given(/D/) { }
|
31
31
|
"""
|
32
32
|
|
33
|
+
@todo-windows
|
33
34
|
Scenario: Run with --format usage
|
34
35
|
When I run `cucumber -f usage --dry-run`
|
35
36
|
Then it should pass with exactly:
|
@@ -55,6 +56,7 @@ Feature: Usage formatter
|
|
55
56
|
|
56
57
|
"""
|
57
58
|
|
59
|
+
@todo-windows
|
58
60
|
Scenario: Run with --expand --format usage
|
59
61
|
When I run `cucumber -x -f usage --dry-run`
|
60
62
|
Then it should pass with exactly:
|
@@ -80,6 +82,7 @@ Feature: Usage formatter
|
|
80
82
|
|
81
83
|
"""
|
82
84
|
|
85
|
+
@todo-windows
|
83
86
|
Scenario: Run with --format stepdefs
|
84
87
|
When I run `cucumber -f stepdefs --dry-run`
|
85
88
|
Then it should pass with exactly:
|
@@ -3,7 +3,7 @@ Feature: Getting started
|
|
3
3
|
To get started, just open a command prompt in an empty directory and run
|
4
4
|
`cucumber`. You'll be prompted for what to do next.
|
5
5
|
|
6
|
-
@spawn
|
6
|
+
@spawn @todo-windows
|
7
7
|
Scenario: Run Cucumber in an empty directory
|
8
8
|
Given a directory without standard Cucumber project directory structure
|
9
9
|
When I run `cucumber`
|
@@ -12,6 +12,7 @@ Feature: Getting started
|
|
12
12
|
No such file or directory - features. You can use `cucumber --init` to get started.
|
13
13
|
"""
|
14
14
|
|
15
|
+
@todo-windows
|
15
16
|
Scenario: Accidentally run Cucumber in a folder with Ruby files in it.
|
16
17
|
Given a directory without standard Cucumber project directory structure
|
17
18
|
And a file named "should_not_load.rb" with:
|
@@ -295,7 +295,7 @@ Feature: Background
|
|
295
295
|
|
296
296
|
"""
|
297
297
|
|
298
|
-
@spawn
|
298
|
+
@spawn @todo-windows
|
299
299
|
Scenario: run a feature with a background that fails
|
300
300
|
When I run `cucumber -q features/failing_background.feature`
|
301
301
|
Then it should fail with exactly:
|
@@ -324,7 +324,7 @@ Feature: Background
|
|
324
324
|
|
325
325
|
"""
|
326
326
|
|
327
|
-
@spawn
|
327
|
+
@spawn @todo-windows
|
328
328
|
Scenario: run a feature with scenario outlines that has a background that fails
|
329
329
|
When I run `cucumber -q features/scenario_outline_failing_background.feature`
|
330
330
|
Then it should fail with exactly:
|
@@ -383,7 +383,7 @@ Feature: Background
|
|
383
383
|
|
384
384
|
"""
|
385
385
|
|
386
|
-
@spawn
|
386
|
+
@spawn @todo-windows
|
387
387
|
Scenario: background passes with first scenario but fails with second
|
388
388
|
When I run `cucumber -q features/failing_background_after_success.feature`
|
389
389
|
Then it should fail with exactly:
|
@@ -412,7 +412,7 @@ Feature: Background
|
|
412
412
|
|
413
413
|
"""
|
414
414
|
|
415
|
-
@spawn
|
415
|
+
@spawn @todo-windows
|
416
416
|
Scenario: background passes with first outline scenario but fails with second
|
417
417
|
When I run `cucumber -q features/failing_background_after_success_outline.feature`
|
418
418
|
Then it should fail with exactly:
|
@@ -448,7 +448,7 @@ Feature: Background
|
|
448
448
|
|
449
449
|
"""
|
450
450
|
|
451
|
-
@spawn
|
451
|
+
@spawn @todo-windows
|
452
452
|
Scenario: background passes with first outline scenario but fails with second (--expand)
|
453
453
|
When I run `cucumber -x -q features/failing_background_after_success_outline.feature`
|
454
454
|
Then it should fail with exactly:
|
@@ -29,6 +29,7 @@ Feature: Doc strings
|
|
29
29
|
You can read the content type from the argument passed into your step definition, as shown
|
30
30
|
in the example below.
|
31
31
|
|
32
|
+
@todo-windows
|
32
33
|
Scenario: Plain text Docstring
|
33
34
|
Given a scenario with a step that looks like this:
|
34
35
|
"""gherkin
|
@@ -53,6 +54,7 @@ Feature: Doc strings
|
|
53
54
|
Three
|
54
55
|
"""
|
55
56
|
|
57
|
+
@todo-windows
|
56
58
|
Scenario: DocString passed as String
|
57
59
|
Given a scenario with a step that looks like this:
|
58
60
|
"""gherkin
|
@@ -43,6 +43,7 @@ Feature: Scenario outlines
|
|
43
43
|
Given(/^failing without a table$/) { raise RuntimeError }
|
44
44
|
"""
|
45
45
|
|
46
|
+
@todo-windows
|
46
47
|
Scenario: Run scenario outline with filtering on outline name
|
47
48
|
When I run `cucumber -q features/outline_sample.feature`
|
48
49
|
Then it should fail with:
|
@@ -76,6 +77,7 @@ Feature: Scenario outlines
|
|
76
77
|
8 steps (1 failed, 2 skipped, 1 undefined, 4 passed)
|
77
78
|
"""
|
78
79
|
|
80
|
+
@todo-windows
|
79
81
|
Scenario: Run scenario outline steps only
|
80
82
|
When I run `cucumber -q features/outline_sample.feature:7`
|
81
83
|
Then it should fail with:
|
@@ -108,6 +110,7 @@ Feature: Scenario outlines
|
|
108
110
|
|
109
111
|
"""
|
110
112
|
|
113
|
+
@todo-windows
|
111
114
|
Scenario: Run single failing scenario outline table row
|
112
115
|
When I run `cucumber -q features/outline_sample.feature:12`
|
113
116
|
Then it should fail with:
|
@@ -134,6 +137,7 @@ Feature: Scenario outlines
|
|
134
137
|
|
135
138
|
"""
|
136
139
|
|
140
|
+
@todo-windows
|
137
141
|
Scenario: Run all with progress formatter
|
138
142
|
When I run `cucumber -q --format progress features/outline_sample.feature`
|
139
143
|
Then it should fail with exactly:
|
@@ -31,7 +31,7 @@ Feature: Using star notation instead of Given/When/Then
|
|
31
31
|
"""
|
32
32
|
You can implement step definitions for undefined steps with these snippets:
|
33
33
|
|
34
|
-
Given(
|
34
|
+
Given("I have some cukes") do
|
35
35
|
pending # Write code here that turns the phrase above into concrete actions
|
36
36
|
end
|
37
37
|
"""
|
@@ -8,7 +8,7 @@ Feature: Post Configuration Hook [#423]
|
|
8
8
|
Given a file named "features/support/env.rb" with:
|
9
9
|
"""
|
10
10
|
AfterConfiguration do |config|
|
11
|
-
config.formats << ['html', config.out_stream]
|
11
|
+
config.formats << ['html', {}, config.out_stream]
|
12
12
|
end
|
13
13
|
"""
|
14
14
|
When I run `cucumber features`
|
@@ -16,6 +16,7 @@ Feature: Rake task
|
|
16
16
|
Given I don't want this ran
|
17
17
|
"""
|
18
18
|
|
19
|
+
@todo-windows
|
19
20
|
Scenario: rake task with a defined profile
|
20
21
|
Given the following profile is defined:
|
21
22
|
"""
|
@@ -41,6 +42,7 @@ Feature: Rake task
|
|
41
42
|
1 step (1 undefined)
|
42
43
|
"""
|
43
44
|
|
45
|
+
@todo-windows
|
44
46
|
Scenario: rake task without a profile
|
45
47
|
Given a file named "Rakefile" with:
|
46
48
|
"""
|
@@ -65,6 +67,7 @@ Feature: Rake task
|
|
65
67
|
2 steps (2 undefined)
|
66
68
|
"""
|
67
69
|
|
70
|
+
@todo-windows
|
68
71
|
Scenario: rake task with a defined profile and cucumber_opts
|
69
72
|
Given the following profile is defined:
|
70
73
|
"""
|
@@ -91,6 +94,7 @@ Feature: Rake task
|
|
91
94
|
1 step (1 undefined)
|
92
95
|
"""
|
93
96
|
|
97
|
+
@todo-windows
|
94
98
|
Scenario: respect requires
|
95
99
|
Given an empty file named "features/support/env.rb"
|
96
100
|
And an empty file named "features/support/dont_require_me.rb"
|
@@ -114,6 +118,7 @@ Feature: Rake task
|
|
114
118
|
* features/support/dont_require_me.rb
|
115
119
|
"""
|
116
120
|
|
121
|
+
@todo-windows
|
117
122
|
Scenario: feature files with spaces
|
118
123
|
Given a file named "features/spaces are nasty.feature" with:
|
119
124
|
"""
|
@@ -1,4 +1,4 @@
|
|
1
|
-
@spawn
|
1
|
+
@spawn @wip-jruby
|
2
2
|
Feature: Raketask
|
3
3
|
|
4
4
|
In order to use cucumber's rake task
|
@@ -34,10 +34,12 @@ Feature: Raketask
|
|
34
34
|
end
|
35
35
|
"""
|
36
36
|
|
37
|
+
@todo-windows
|
37
38
|
Scenario: Passing feature
|
38
39
|
When I run `bundle exec rake pass`
|
39
40
|
Then the exit status should be 0
|
40
41
|
|
42
|
+
@todo-windows
|
41
43
|
Scenario: Failing feature
|
42
44
|
When I run `bundle exec rake fail`
|
43
45
|
Then the exit status should be 1
|
@@ -37,6 +37,7 @@ Feature: Cucumber --work-in-progress switch
|
|
37
37
|
| passes |
|
38
38
|
"""
|
39
39
|
|
40
|
+
@todo-windows
|
40
41
|
Scenario: Pass with Failing Scenarios
|
41
42
|
When I run `cucumber -q -w -t @failing features/wip.feature`
|
42
43
|
Then the stderr should not contain anything
|
@@ -63,6 +64,7 @@ Feature: Cucumber --work-in-progress switch
|
|
63
64
|
|
64
65
|
"""
|
65
66
|
|
67
|
+
@todo-windows
|
66
68
|
Scenario: Pass with Undefined Scenarios
|
67
69
|
When I run `cucumber -q -w -t @undefined features/wip.feature`
|
68
70
|
Then it should pass with:
|
@@ -82,6 +84,7 @@ Feature: Cucumber --work-in-progress switch
|
|
82
84
|
|
83
85
|
"""
|
84
86
|
|
87
|
+
@todo-windows
|
85
88
|
Scenario: Pass with Undefined Scenarios
|
86
89
|
When I run `cucumber -q -w -t @pending features/wip.feature`
|
87
90
|
Then it should pass with:
|
@@ -104,6 +107,7 @@ Feature: Cucumber --work-in-progress switch
|
|
104
107
|
|
105
108
|
"""
|
106
109
|
|
110
|
+
@todo-windows
|
107
111
|
Scenario: Fail with Passing Scenarios
|
108
112
|
When I run `cucumber -q -w -t @passing features/wip.feature`
|
109
113
|
Then it should fail with:
|
@@ -124,9 +128,9 @@ Feature: Cucumber --work-in-progress switch
|
|
124
128
|
|
125
129
|
features/wip.feature:15:in `Scenario: Passing'
|
126
130
|
|
127
|
-
|
128
131
|
"""
|
129
132
|
|
133
|
+
@todo-windows
|
130
134
|
Scenario: Fail with Passing Scenario Outline
|
131
135
|
When I run `cucumber -q -w features/passing_outline.feature`
|
132
136
|
Then it should fail with:
|
@@ -150,5 +154,4 @@ Feature: Cucumber --work-in-progress switch
|
|
150
154
|
|
151
155
|
features/passing_outline.feature:7:in `Scenario Outline: Passing, Examples (#1)'
|
152
156
|
|
153
|
-
|
154
157
|
"""
|
@@ -12,6 +12,7 @@ Feature: AfterStep Hooks
|
|
12
12
|
Given this step passes
|
13
13
|
"""
|
14
14
|
|
15
|
+
@todo-windows
|
15
16
|
Scenario: Access Test Step object in AfterStep Block
|
16
17
|
Given a file named "features/support/env.rb" with:
|
17
18
|
"""
|
@@ -32,6 +33,7 @@ Feature: AfterStep Hooks
|
|
32
33
|
|
33
34
|
"""
|
34
35
|
|
36
|
+
@todo-windows
|
35
37
|
Scenario: An AfterStep with one named argument receives only the result
|
36
38
|
Given a file named "features/support/env.rb" with:
|
37
39
|
"""
|
@@ -50,4 +52,4 @@ Feature: AfterStep Hooks
|
|
50
52
|
1 scenario (1 passed)
|
51
53
|
1 step (1 passed)
|
52
54
|
|
53
|
-
"""
|
55
|
+
"""
|
@@ -5,6 +5,7 @@ Feature: Around hooks
|
|
5
5
|
that provide only a block syntax for transactions, Cucumber should
|
6
6
|
permit definition of Around hooks.
|
7
7
|
|
8
|
+
@todo-windows
|
8
9
|
Scenario: A single Around hook
|
9
10
|
Given a file named "features/step_definitions/steps.rb" with:
|
10
11
|
"""
|
@@ -38,6 +39,7 @@ Feature: Around hooks
|
|
38
39
|
|
39
40
|
"""
|
40
41
|
|
42
|
+
@todo-windows
|
41
43
|
Scenario: Multiple Around hooks
|
42
44
|
Given a file named "features/step_definitions/steps.rb" with:
|
43
45
|
"""
|
@@ -84,6 +86,7 @@ Feature: Around hooks
|
|
84
86
|
|
85
87
|
"""
|
86
88
|
|
89
|
+
@todo-windows
|
87
90
|
Scenario: Mixing Around, Before, and After hooks
|
88
91
|
Given a file named "features/step_definitions/steps.rb" with:
|
89
92
|
"""
|
@@ -131,6 +134,7 @@ Feature: Around hooks
|
|
131
134
|
|
132
135
|
"""
|
133
136
|
|
137
|
+
@todo-windows
|
134
138
|
Scenario: Around hooks with tags
|
135
139
|
Given a file named "features/step_definitions/steps.rb" with:
|
136
140
|
"""
|
@@ -185,6 +189,7 @@ Feature: Around hooks
|
|
185
189
|
|
186
190
|
"""
|
187
191
|
|
192
|
+
@todo-windows
|
188
193
|
Scenario: Around hooks with scenario outlines
|
189
194
|
Given a file named "features/step_definitions/steps.rb" with:
|
190
195
|
"""
|
@@ -228,6 +233,7 @@ Feature: Around hooks
|
|
228
233
|
|
229
234
|
"""
|
230
235
|
|
236
|
+
@todo-windows
|
231
237
|
Scenario: Around Hooks and the Custom World
|
232
238
|
Given a file named "features/step_definitions/steps.rb" with:
|
233
239
|
"""
|
@@ -46,6 +46,7 @@
|
|
46
46
|
Given scenario step
|
47
47
|
"""
|
48
48
|
|
49
|
+
@todo-windows
|
49
50
|
Scenario: Around hooks cover background steps
|
50
51
|
When I run `cucumber -o /dev/null features/around_hook_covers_background.feature`
|
51
52
|
Then the output should contain:
|
@@ -53,9 +54,10 @@
|
|
53
54
|
Event order: around_begin background_step scenario_step around_end
|
54
55
|
"""
|
55
56
|
|
57
|
+
@todo-windows
|
56
58
|
Scenario: All hooks execute in expected order
|
57
59
|
When I run `cucumber -o /dev/null features/all_hook_order.feature`
|
58
60
|
Then the output should contain:
|
59
61
|
"""
|
60
62
|
Event order: around_begin before background_step scenario_step after around_end
|
61
|
-
"""
|
63
|
+
"""
|
@@ -0,0 +1,75 @@
|
|
1
|
+
Feature: Parameter Types
|
2
|
+
|
3
|
+
Parameter Types allow you to convert primitive string arguments captured in step definitions
|
4
|
+
into more meaningful data types.
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Let's just create a simple feature for testing out parameter types.
|
8
|
+
We also have a Person class that we need to be able to build.
|
9
|
+
|
10
|
+
Given a file named "features/foo.feature" with:
|
11
|
+
"""
|
12
|
+
Feature:
|
13
|
+
Scenario:
|
14
|
+
Given Joe has gone home
|
15
|
+
When Sally contacts Joe
|
16
|
+
"""
|
17
|
+
And a file named "features/step_definitions/steps.rb" with:
|
18
|
+
"""
|
19
|
+
# It works with Regular Expressions
|
20
|
+
Given /([A-Z]\w+) has gone home/ do |person|
|
21
|
+
expect(person.name).to eq 'Joe'
|
22
|
+
end
|
23
|
+
|
24
|
+
# It works with Cucumber Expressions too
|
25
|
+
When "{person} contacts {person}" do |contacter, contactee|
|
26
|
+
expect(contacter.name).to eq 'Sally'
|
27
|
+
expect(contactee.name).to eq 'Joe'
|
28
|
+
end
|
29
|
+
"""
|
30
|
+
And a file named "features/support/env.rb" with:
|
31
|
+
"""
|
32
|
+
class Person
|
33
|
+
attr_reader :name
|
34
|
+
|
35
|
+
def initialize(name)
|
36
|
+
@name = name
|
37
|
+
end
|
38
|
+
end
|
39
|
+
"""
|
40
|
+
|
41
|
+
Scenario: Parameter type defined with ParameterType method
|
42
|
+
This is the most basic way to use a parameter type.
|
43
|
+
|
44
|
+
Given a file named "features/support/parameter_types.rb" with:
|
45
|
+
"""
|
46
|
+
ParameterType(
|
47
|
+
name: 'person',
|
48
|
+
regexp: /[A-Z]\w+/,
|
49
|
+
type: Person,
|
50
|
+
transformer: lambda do |name|
|
51
|
+
Person.new(name)
|
52
|
+
end,
|
53
|
+
use_for_snippets: true,
|
54
|
+
prefer_for_regexp_match: false
|
55
|
+
)
|
56
|
+
"""
|
57
|
+
When I run `cucumber features/foo.feature`
|
58
|
+
Then it should pass
|
59
|
+
|
60
|
+
Scenario: Parameter type defined with legacy Transform method
|
61
|
+
This is for backwards compatibility - works with regular expressions,
|
62
|
+
but not with Cucumber Expressions, because no name is specified for the
|
63
|
+
parameter type.
|
64
|
+
|
65
|
+
Given a file named "features/support/transforms.rb" with:
|
66
|
+
"""
|
67
|
+
Transform(/[A-Z]\w+/) do |name|
|
68
|
+
Person.new(name)
|
69
|
+
end
|
70
|
+
"""
|
71
|
+
When I run `cucumber features/foo.feature`
|
72
|
+
Then it should fail with:
|
73
|
+
"""
|
74
|
+
Undefined parameter type {person}
|
75
|
+
"""
|