cucumber 2.99.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.cucumberproignore +6 -0
- data/.gitattributes +32 -0
- data/.github/ISSUE_TEMPLATE.md +1 -1
- data/.github/PULL_REQUEST_TEMPLATE.md +1 -0
- data/.rubocop.yml +13 -0
- data/.rubocop_todo.yml +991 -0
- data/.travis.yml +56 -10
- data/{History.md → CHANGELOG.md} +166 -32
- data/CONTRIBUTING.md +21 -1
- data/Gemfile +18 -5
- data/README.md +13 -4
- data/Rakefile +12 -2
- data/appveyor.yml +27 -0
- data/bin/cucumber +2 -1
- data/cucumber.gemspec +15 -10
- data/cucumber.yml +10 -11
- data/examples/i18n/Rakefile +1 -1
- data/examples/i18n/ar/features/step_definitions/calculator_steps.rb +8 -3
- data/examples/i18n/ar/lib/calculator.rb +2 -2
- data/examples/i18n/bg/features/step_definitions/calculator_steps.rb +6 -6
- data/examples/i18n/bg/features/support/env.rb +6 -1
- data/examples/i18n/bg/lib/calculator.rb +2 -1
- data/examples/i18n/ca/features/step_definitions/calculator_steps.rb +10 -5
- data/examples/i18n/ca/lib/calculadora.rb +2 -2
- data/examples/i18n/cs/features/step_definitions/calculator_steps.rb +10 -5
- data/examples/i18n/cs/lib/calculator.rb +3 -3
- data/examples/i18n/da/features/step_definitions/lommeregner_steps.rb +10 -5
- data/examples/i18n/da/lib/lommeregner.rb +2 -2
- data/examples/i18n/de/features/step_definitions/calculator_steps.rb +10 -5
- data/examples/i18n/de/lib/calculator.rb +2 -2
- data/examples/i18n/el/features/step_definitions/calculator_steps.rb +10 -5
- data/examples/i18n/el/lib/calculator.rb +2 -2
- data/examples/i18n/en/features/step_definitions/calculator_steps.rb +9 -4
- data/examples/i18n/en/lib/calculator.rb +2 -2
- data/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb +4 -4
- data/examples/i18n/en-lol/features/support/env.rb +6 -2
- data/examples/i18n/en-lol/lib/basket.rb +2 -2
- data/examples/i18n/en-lol/lib/belly.rb +2 -2
- data/examples/i18n/eo/features/step_definitions/calculator_steps.rb +9 -4
- data/examples/i18n/eo/lib/calculator.rb +2 -2
- data/examples/i18n/es/features/step_definitions/calculador_steps.rb +10 -5
- data/examples/i18n/es/lib/calculador.rb +2 -2
- data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +10 -5
- data/examples/i18n/et/lib/kalkulaator.rb +3 -3
- data/examples/i18n/fi/features/step_definitions/laskin_steps.rb +9 -4
- 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 +7 -2
- data/examples/i18n/fr/lib/calculatrice.rb +2 -2
- data/examples/i18n/he/features/step_definitions/calculator_steps.rb +10 -5
- data/examples/i18n/he/lib/calculator.rb +1 -1
- data/examples/i18n/hi/features/step_definitions/calculator_steps.rb +9 -4
- data/examples/i18n/hi/lib/calculator.rb +1 -1
- data/examples/i18n/ht/features/step_definitions/kalkilatris_steps.rb +9 -5
- data/examples/i18n/ht/lib/kalkilatris.rb +2 -2
- data/examples/i18n/hu/features/step_definitions/calculator_steps.rb +10 -5
- data/examples/i18n/hu/lib/calculator.rb +1 -1
- data/examples/i18n/id/features/step_definitions/calculator_steps.rb +10 -5
- data/examples/i18n/id/lib/calculator.rb +2 -2
- data/examples/i18n/it/features/step_definitions/calcolatrice_steps.rb +10 -5
- 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 +7 -2
- data/examples/i18n/ja/lib/calculator.rb +2 -2
- data/examples/i18n/ko/features/step_definitions/calculator_steps.rb +10 -5
- data/examples/i18n/ko/lib/calculator.rb +2 -2
- data/examples/i18n/lt/features/step_definitions/calculator_steps.rb +10 -5
- data/examples/i18n/lt/lib/calculator.rb +2 -2
- data/examples/i18n/lv/features/step_definitions/calculator_steps.rb +10 -5
- 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 +7 -2
- data/examples/i18n/no/lib/kalkulator.rb +2 -2
- data/examples/i18n/pl/features/step_definitions/calculator_steps.rb +10 -5
- data/examples/i18n/pl/features/support/env.rb +6 -1
- 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 +7 -2
- data/examples/i18n/pt/lib/calculadora.rb +1 -1
- data/examples/i18n/ro/features/step_definitions/calculator_steps.rb +11 -6
- data/examples/i18n/ro/lib/calculator.rb +1 -1
- data/examples/i18n/ru/features/step_definitions/calculator_steps.rb +5 -5
- data/examples/i18n/ru/features/support/env.rb +6 -1
- data/examples/i18n/ru/lib/calculator.rb +2 -1
- data/examples/i18n/sk/features/step_definitions/calculator_steps.rb +10 -5
- 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 +7 -2
- data/examples/i18n/sr-Cyrl/lib/calculator.rb +2 -2
- data/examples/i18n/sr-Latn/features/step_definitions/calculator_steps.rb +10 -5
- data/examples/i18n/sr-Latn/lib/calculator.rb +2 -2
- data/examples/i18n/sv/features/step_definitions/kalkulator_steps.rb +9 -4
- data/examples/i18n/sv/lib/kalkulator.rb +2 -2
- data/examples/i18n/tr/features/step_definitions/hesap_makinesi_adimlari.rb +10 -5
- 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/uk/features/support/env.rb +6 -1
- data/examples/i18n/uk/lib/calculator.rb +2 -1
- data/examples/i18n/uz/features/step_definitions/calculator_steps.rb +4 -4
- data/examples/i18n/uz/features/support/env.rb +6 -1
- data/examples/i18n/uz/lib/calculator.rb +2 -1
- data/examples/i18n/zh-CN/features/step_definitions/calculator_steps.rb +11 -6
- data/examples/i18n/zh-CN/lib/calculator.rb +2 -2
- data/examples/i18n/zh-TW/features/step_definitions/calculator_steps.rb +10 -5
- 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/sinatra/features/support/env.rb +6 -1
- data/examples/tcl/features/step_definitions/fib_steps.rb +2 -2
- data/examples/tcl/features/support/env.rb +2 -1
- data/examples/test_unit/features/step_definitions/test_unit_steps.rb +4 -4
- data/examples/watir/features/step_definitions/search_steps.rb +6 -5
- data/examples/watir/features/support/env.rb +5 -1
- 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 +9 -8
- 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 +8 -6
- data/features/docs/cli/fail_fast.feature +2 -0
- data/features/docs/cli/help.feature +8 -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 +75 -15
- 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/ambiguous_steps.feature +89 -0
- data/features/docs/defining_steps/nested_steps.feature +5 -1
- data/features/docs/defining_steps/nested_steps_i18n.feature +3 -0
- data/features/docs/defining_steps/nested_steps_with_second_arg.feature +2 -0
- data/features/docs/defining_steps/printing_messages.feature +1 -2
- data/features/docs/defining_steps/skip_scenario.feature +1 -34
- 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_started_event.feature +54 -0
- data/features/docs/events/test_run_finished_event.feature +40 -0
- data/features/docs/events/test_run_started_event.feature +41 -0
- data/features/docs/events/test_step_finished_event.feature +47 -0
- data/features/docs/events/test_step_started_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 +12 -48
- 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 +35 -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 +6 -4
- data/features/docs/gherkin/unicode_table.feature +2 -1
- 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 -17
- 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 +53 -0
- data/features/docs/writing_support_code/tagged_hooks.feature +1 -1
- data/features/docs/writing_support_code/world.feature +129 -0
- data/features/lib/step_definitions/aruba_steps.rb +5 -10
- data/features/lib/step_definitions/cli_steps.rb +4 -0
- data/features/lib/step_definitions/cucumber_steps.rb +9 -12
- data/features/lib/step_definitions/iso-8859-1_steps.rb +9 -5
- data/features/lib/step_definitions/json_steps.rb +2 -1
- data/features/lib/step_definitions/junit_steps.rb +2 -1
- data/features/lib/step_definitions/language_steps.rb +3 -2
- data/features/lib/step_definitions/profile_steps.rb +7 -6
- data/features/lib/step_definitions/retry_steps.rb +33 -13
- data/features/lib/step_definitions/ruby_steps.rb +2 -1
- data/features/lib/support/env.rb +3 -2
- data/features/lib/support/fake_wire_server.rb +17 -3
- data/features/lib/support/feature_factory.rb +2 -1
- data/features/lib/support/normalise_output.rb +14 -12
- data/features/lib/support/parameter_types.rb +5 -0
- data/gem_tasks/contributors.rake +10 -6
- data/gem_tasks/cov.rake +1 -0
- data/gem_tasks/downloads.rb +1 -0
- data/gem_tasks/environment.rake +2 -5
- data/gem_tasks/examples.rake +3 -2
- data/gem_tasks/fix_cr_lf.rake +19 -7
- data/gem_tasks/flog.rake +4 -3
- data/gem_tasks/rspec.rake +2 -1
- data/gem_tasks/sass.rake +2 -1
- data/lib/autotest/cucumber.rb +1 -0
- data/lib/autotest/cucumber_mixin.rb +17 -16
- data/lib/autotest/cucumber_rails.rb +1 -0
- data/lib/autotest/cucumber_rails_rspec.rb +1 -0
- data/lib/autotest/cucumber_rails_rspec2.rb +1 -0
- data/lib/autotest/cucumber_rspec.rb +1 -0
- data/lib/autotest/cucumber_rspec2.rb +1 -0
- data/lib/autotest/discover.rb +3 -2
- data/lib/cucumber/cli/configuration.rb +12 -21
- data/lib/cucumber/cli/main.rb +8 -7
- data/lib/cucumber/cli/options.rb +341 -217
- data/lib/cucumber/cli/profile_loader.rb +26 -21
- data/lib/cucumber/cli/rerun_file.rb +1 -0
- data/lib/cucumber/configuration.rb +54 -37
- data/lib/cucumber/constantize.rb +2 -1
- data/lib/cucumber/core_ext/string.rb +2 -1
- data/lib/cucumber/deprecate.rb +4 -3
- data/lib/cucumber/encoding.rb +1 -0
- data/lib/cucumber/errors.rb +3 -1
- data/lib/cucumber/events/gherkin_source_read.rb +17 -0
- data/lib/cucumber/events/{step_match.rb → step_activated.rb} +5 -2
- data/lib/cucumber/events/step_definition_registered.rb +24 -0
- data/lib/cucumber/events/test_case_finished.rb +18 -0
- data/lib/cucumber/events/test_case_started.rb +15 -0
- data/lib/cucumber/events/test_run_finished.rb +12 -0
- data/lib/cucumber/events/test_run_started.rb +16 -0
- data/lib/cucumber/events/test_step_finished.rb +20 -0
- data/lib/cucumber/events/test_step_started.rb +17 -0
- data/lib/cucumber/events.rb +23 -3
- data/lib/cucumber/file_specs.rb +1 -0
- data/lib/cucumber/filters/activate_steps.rb +8 -3
- data/lib/cucumber/filters/apply_after_hooks.rb +1 -0
- data/lib/cucumber/filters/apply_after_step_hooks.rb +1 -0
- data/lib/cucumber/filters/apply_around_hooks.rb +1 -0
- data/lib/cucumber/filters/apply_before_hooks.rb +1 -0
- data/lib/cucumber/filters/broadcast_test_run_started_event.rb +27 -0
- data/lib/cucumber/filters/gated_receiver.rb +1 -0
- data/lib/cucumber/filters/prepare_world.rb +1 -0
- data/lib/cucumber/filters/quit.rb +1 -0
- data/lib/cucumber/filters/randomizer.rb +1 -0
- data/lib/cucumber/filters/retry.rb +4 -4
- data/lib/cucumber/filters/tag_limits/test_case_index.rb +1 -0
- data/lib/cucumber/filters/tag_limits/verifier.rb +2 -1
- data/lib/cucumber/filters/tag_limits.rb +4 -3
- data/lib/cucumber/filters.rb +3 -0
- data/lib/cucumber/formatter/ansicolor.rb +9 -11
- data/lib/cucumber/formatter/backtrace_filter.rb +21 -8
- data/lib/cucumber/formatter/console.rb +72 -66
- data/lib/cucumber/formatter/console_counts.rb +44 -0
- data/lib/cucumber/formatter/console_issues.rb +58 -0
- data/lib/cucumber/formatter/duration.rb +2 -1
- data/lib/cucumber/formatter/duration_extractor.rb +1 -0
- data/lib/cucumber/formatter/fail_fast.rb +4 -2
- data/lib/cucumber/formatter/fanout.rb +1 -0
- data/lib/cucumber/formatter/hook_query_visitor.rb +1 -0
- data/lib/cucumber/formatter/html.rb +175 -249
- data/lib/cucumber/formatter/html_builder.rb +120 -0
- data/lib/cucumber/formatter/ignore_missing_messages.rb +1 -0
- data/lib/cucumber/formatter/inline-js.js +30 -0
- data/lib/cucumber/formatter/interceptor.rb +3 -2
- data/lib/cucumber/formatter/io.rb +2 -1
- data/lib/cucumber/formatter/json.rb +33 -30
- data/lib/cucumber/formatter/json_pretty.rb +1 -0
- data/lib/cucumber/formatter/junit.rb +26 -24
- data/lib/cucumber/formatter/legacy_api/adapter.rb +81 -69
- data/lib/cucumber/formatter/legacy_api/ast.rb +27 -22
- data/lib/cucumber/formatter/legacy_api/results.rb +7 -8
- data/lib/cucumber/formatter/legacy_api/runtime_facade.rb +1 -0
- data/lib/cucumber/formatter/pretty.rb +24 -18
- data/lib/cucumber/formatter/progress.rb +55 -13
- data/lib/cucumber/formatter/rerun.rb +15 -18
- data/lib/cucumber/formatter/stepdefs.rb +1 -0
- data/lib/cucumber/formatter/steps.rb +2 -1
- data/lib/cucumber/formatter/summary.rb +43 -20
- data/lib/cucumber/formatter/unicode.rb +2 -1
- data/lib/cucumber/formatter/usage.rb +33 -28
- data/lib/cucumber/gherkin/data_table_parser.rb +1 -0
- data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +2 -1
- data/lib/cucumber/gherkin/formatter/escaping.rb +2 -1
- data/lib/cucumber/gherkin/i18n.rb +1 -0
- data/lib/cucumber/gherkin/steps_parser.rb +1 -0
- data/lib/cucumber/{rb_support/rb_dsl.rb → glue/dsl.rb} +41 -30
- 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 +220 -0
- data/lib/cucumber/{rb_support/rb_language.rb → glue/registry_and_more.rb} +60 -90
- data/lib/cucumber/{rb_support → glue}/snippet.rb +64 -26
- data/lib/cucumber/glue/step_definition.rb +143 -0
- data/lib/cucumber/glue/world_factory.rb +23 -0
- data/lib/cucumber/hooks.rb +9 -8
- data/lib/cucumber/load_path.rb +1 -0
- data/lib/cucumber/multiline_argument/data_table/diff_matrices.rb +158 -0
- data/lib/cucumber/multiline_argument/data_table.rb +47 -181
- data/lib/cucumber/multiline_argument/doc_string.rb +1 -0
- data/lib/cucumber/multiline_argument.rb +6 -15
- data/lib/cucumber/platform.rb +4 -5
- data/lib/cucumber/project_initializer.rb +3 -2
- data/lib/cucumber/rake/task.rb +19 -14
- data/lib/cucumber/rspec/disable_option_parser.rb +2 -1
- data/lib/cucumber/rspec/doubles.rb +2 -1
- data/lib/cucumber/running_test_case.rb +3 -27
- data/lib/cucumber/runtime/after_hooks.rb +2 -1
- data/lib/cucumber/runtime/before_hooks.rb +1 -0
- data/lib/cucumber/runtime/for_programming_languages.rb +2 -36
- data/lib/cucumber/runtime/step_hooks.rb +1 -0
- data/lib/cucumber/runtime/support_code.rb +21 -16
- data/lib/cucumber/runtime/user_interface.rb +10 -16
- data/lib/cucumber/runtime.rb +49 -32
- data/lib/cucumber/step_argument.rb +1 -2
- data/lib/cucumber/step_definition_light.rb +2 -0
- data/lib/cucumber/step_definitions.rb +1 -0
- data/lib/cucumber/step_match.rb +30 -15
- data/lib/cucumber/step_match_search.rb +3 -3
- data/lib/cucumber/term/ansicolor.rb +2 -1
- data/lib/cucumber/unit.rb +1 -0
- data/lib/cucumber/version +1 -1
- data/lib/cucumber.rb +1 -13
- data/lib/simplecov_setup.rb +2 -1
- data/scripts/invite-collaborator +40 -0
- data/scripts/update-changelog +86 -0
- data/spec/cucumber/cli/configuration_spec.rb +109 -98
- data/spec/cucumber/cli/main_spec.rb +8 -7
- data/spec/cucumber/cli/options_spec.rb +114 -79
- data/spec/cucumber/cli/profile_loader_spec.rb +25 -5
- data/spec/cucumber/cli/rerun_spec.rb +21 -20
- data/spec/cucumber/configuration_spec.rb +48 -47
- data/spec/cucumber/constantize_spec.rb +3 -2
- data/spec/cucumber/events_spec.rb +9 -0
- data/spec/cucumber/file_specs_spec.rb +26 -25
- data/spec/cucumber/filters/activate_steps_spec.rb +25 -22
- data/spec/cucumber/filters/gated_receiver_spec.rb +7 -6
- data/spec/cucumber/filters/retry_spec.rb +42 -23
- data/spec/cucumber/filters/tag_limits/test_case_index_spec.rb +12 -11
- data/spec/cucumber/filters/tag_limits/verifier_spec.rb +15 -14
- data/spec/cucumber/filters/tag_limits_spec.rb +9 -8
- data/spec/cucumber/formatter/ansicolor_spec.rb +10 -9
- data/spec/cucumber/formatter/backtrace_filter_spec.rb +32 -0
- data/spec/cucumber/formatter/console_counts_spec.rb +14 -0
- data/spec/cucumber/formatter/duration_spec.rb +4 -3
- data/spec/cucumber/formatter/fail_fast_spec.rb +27 -27
- data/spec/cucumber/formatter/html_spec.rb +65 -60
- data/spec/cucumber/formatter/interceptor_spec.rb +1 -0
- data/spec/cucumber/formatter/json_spec.rb +71 -97
- data/spec/cucumber/formatter/junit_spec.rb +46 -47
- data/spec/cucumber/formatter/legacy_api/adapter_spec.rb +134 -141
- data/spec/cucumber/formatter/pretty_spec.rb +105 -117
- data/spec/cucumber/formatter/progress_spec.rb +22 -21
- data/spec/cucumber/formatter/rerun_spec.rb +70 -64
- data/spec/cucumber/formatter/spec_helper.rb +14 -12
- data/spec/cucumber/{rb_support/rb_world_spec.rb → glue/proto_world_spec.rb} +22 -6
- data/spec/cucumber/glue/registry_and_more_spec.rb +213 -0
- data/spec/cucumber/{rb_support → glue}/snippet_spec.rb +62 -25
- data/spec/cucumber/glue/step_definition_spec.rb +207 -0
- data/spec/cucumber/hooks_spec.rb +5 -4
- data/spec/cucumber/multiline_argument/data_table_spec.rb +179 -129
- data/spec/cucumber/project_initializer_spec.rb +12 -11
- data/spec/cucumber/rake/forked_spec.rb +22 -17
- data/spec/cucumber/rake/task_spec.rb +21 -20
- data/spec/cucumber/running_test_case_spec.rb +36 -35
- data/spec/cucumber/runtime/for_programming_languages_spec.rb +2 -30
- data/spec/cucumber/runtime/support_code_spec.rb +1 -0
- data/spec/cucumber/runtime_spec.rb +3 -2
- data/spec/cucumber/step_argument_spec.rb +6 -5
- data/spec/cucumber/step_match_search_spec.rb +32 -41
- data/spec/cucumber/step_match_spec.rb +34 -33
- data/spec/cucumber/world/pending_spec.rb +12 -11
- data/spec/spec_helper.rb +1 -0
- data/spec/support/standard_step_actions.rb +2 -1
- metadata +132 -61
- data/features/docs/formatters/debug_formatter.feature +0 -47
- data/features/docs/formatters/formatter_step_file_colon_line.feature +0 -44
- data/features/docs/writing_support_code/transforms.feature +0 -98
- data/features/lib/step_definitions/wire_steps.rb +0 -58
- data/gem_tasks/cucumber.rake +0 -25
- data/lib/cucumber/ast.rb +0 -13
- data/lib/cucumber/core_ext/instance_exec.rb +0 -70
- data/lib/cucumber/events/after_test_case.rb +0 -25
- data/lib/cucumber/events/after_test_step.rb +0 -30
- data/lib/cucumber/events/before_test_case.rb +0 -18
- data/lib/cucumber/events/before_test_step.rb +0 -23
- data/lib/cucumber/events/bus.rb +0 -86
- data/lib/cucumber/events/finished_testing.rb +0 -9
- data/lib/cucumber/formatter/debug.rb +0 -35
- data/lib/cucumber/formatter/event_bus_report.rb +0 -38
- data/lib/cucumber/rb_support/rb_hook.rb +0 -19
- data/lib/cucumber/rb_support/rb_step_definition.rb +0 -131
- data/lib/cucumber/rb_support/rb_transform.rb +0 -59
- data/lib/cucumber/rb_support/rb_world.rb +0 -149
- data/spec/cucumber/core_ext/instance_exec_spec.rb +0 -4
- data/spec/cucumber/events/bus_spec.rb +0 -94
- data/spec/cucumber/formatter/debug_spec.rb +0 -64
- data/spec/cucumber/formatter/event_bus_report_spec.rb +0 -88
- data/spec/cucumber/rb_support/rb_language_spec.rb +0 -243
- data/spec/cucumber/rb_support/rb_step_definition_spec.rb +0 -199
- data/spec/cucumber/rb_support/rb_transform_spec.rb +0 -46
- data/spec/cucumber_spec.rb +0 -39
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
require 'spec_helper'
|
|
2
3
|
require 'cucumber/formatter/spec_helper'
|
|
3
4
|
require 'cucumber/formatter/pretty'
|
|
@@ -9,32 +10,19 @@ module Cucumber
|
|
|
9
10
|
extend SpecHelperDsl
|
|
10
11
|
include SpecHelper
|
|
11
12
|
|
|
12
|
-
context
|
|
13
|
+
context 'With no options' do
|
|
13
14
|
before(:each) do
|
|
14
15
|
Cucumber::Term::ANSIColor.coloring = false
|
|
15
16
|
@out = StringIO.new
|
|
16
17
|
@formatter = Pretty.new(runtime, @out, {})
|
|
17
18
|
end
|
|
18
19
|
|
|
19
|
-
describe
|
|
20
|
+
describe 'given a single feature' do
|
|
20
21
|
before(:each) do
|
|
21
22
|
run_defined_feature
|
|
22
23
|
end
|
|
23
24
|
|
|
24
|
-
describe
|
|
25
|
-
define_feature <<-FEATURE
|
|
26
|
-
Feature: Banana party
|
|
27
|
-
|
|
28
|
-
Scenario: Monkey eats banana
|
|
29
|
-
FEATURE
|
|
30
|
-
|
|
31
|
-
it "outputs the scenario name" do
|
|
32
|
-
expect(@out.string).to include "Scenario: Monkey eats banana"
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
describe "with a scenario" do
|
|
25
|
+
describe 'with a scenario' do
|
|
38
26
|
define_feature <<-FEATURE
|
|
39
27
|
Feature: Banana party
|
|
40
28
|
|
|
@@ -42,16 +30,16 @@ module Cucumber
|
|
|
42
30
|
Given there are bananas
|
|
43
31
|
FEATURE
|
|
44
32
|
|
|
45
|
-
it
|
|
46
|
-
expect(@out.string).to include
|
|
33
|
+
it 'outputs the scenario name' do
|
|
34
|
+
expect(@out.string).to include 'Scenario: Monkey eats banana'
|
|
47
35
|
end
|
|
48
36
|
|
|
49
|
-
it
|
|
50
|
-
expect(@out.string).to include
|
|
37
|
+
it 'outputs the step' do
|
|
38
|
+
expect(@out.string).to include 'Given there are bananas'
|
|
51
39
|
end
|
|
52
40
|
end
|
|
53
41
|
|
|
54
|
-
describe
|
|
42
|
+
describe 'with a background' do
|
|
55
43
|
define_feature <<-FEATURE
|
|
56
44
|
Feature: Banana party
|
|
57
45
|
|
|
@@ -62,20 +50,20 @@ Feature: Banana party
|
|
|
62
50
|
Given there are bananas
|
|
63
51
|
FEATURE
|
|
64
52
|
|
|
65
|
-
it
|
|
53
|
+
it 'outputs the gherkin' do
|
|
66
54
|
expect(@out.string).to include(self.class.feature_content)
|
|
67
55
|
end
|
|
68
56
|
|
|
69
|
-
it
|
|
70
|
-
expect(@out.string).to include
|
|
57
|
+
it 'outputs the scenario name' do
|
|
58
|
+
expect(@out.string).to include 'Scenario: Monkey eats banana'
|
|
71
59
|
end
|
|
72
60
|
|
|
73
|
-
it
|
|
74
|
-
expect(@out.string).to include
|
|
61
|
+
it 'outputs the step' do
|
|
62
|
+
expect(@out.string).to include 'Given there are bananas'
|
|
75
63
|
end
|
|
76
64
|
end
|
|
77
65
|
|
|
78
|
-
describe
|
|
66
|
+
describe 'with a scenario outline' do
|
|
79
67
|
define_feature <<-FEATURE
|
|
80
68
|
Feature: Fud Pyramid
|
|
81
69
|
|
|
@@ -92,7 +80,7 @@ Feature: Banana party
|
|
|
92
80
|
| carrots |
|
|
93
81
|
FEATURE
|
|
94
82
|
|
|
95
|
-
it
|
|
83
|
+
it 'outputs the scenario outline' do
|
|
96
84
|
lines = <<-OUTPUT
|
|
97
85
|
Examples: Fruit
|
|
98
86
|
| Things |
|
|
@@ -108,12 +96,12 @@ Feature: Banana party
|
|
|
108
96
|
end
|
|
109
97
|
end
|
|
110
98
|
|
|
111
|
-
it
|
|
112
|
-
expect(@out.string).to include
|
|
99
|
+
it 'has 4 undefined scenarios' do
|
|
100
|
+
expect(@out.string).to include '4 scenarios (4 undefined)'
|
|
113
101
|
end
|
|
114
102
|
|
|
115
|
-
it
|
|
116
|
-
expect(@out.string).to include
|
|
103
|
+
it 'has 4 undefined steps' do
|
|
104
|
+
expect(@out.string).to include '4 steps (4 undefined)'
|
|
117
105
|
end
|
|
118
106
|
|
|
119
107
|
context 'when the examples table header is wider than the rows' do
|
|
@@ -128,7 +116,7 @@ Feature: Banana party
|
|
|
128
116
|
| Hominidae |
|
|
129
117
|
FEATURE
|
|
130
118
|
|
|
131
|
-
it
|
|
119
|
+
it 'outputs the scenario outline' do
|
|
132
120
|
lines = <<-OUTPUT
|
|
133
121
|
Examples:
|
|
134
122
|
| Types of monkey |
|
|
@@ -142,7 +130,7 @@ Feature: Banana party
|
|
|
142
130
|
end
|
|
143
131
|
|
|
144
132
|
# To ensure https://rspec.lighthouseapp.com/projects/16211/tickets/475 remains fixed.
|
|
145
|
-
describe
|
|
133
|
+
describe 'with a scenario outline with a pystring' do
|
|
146
134
|
define_feature <<-FEATURE
|
|
147
135
|
Feature:
|
|
148
136
|
Scenario Outline: Monkey eats a balanced diet
|
|
@@ -156,7 +144,7 @@ Feature: Banana party
|
|
|
156
144
|
| apples |
|
|
157
145
|
FEATURE
|
|
158
146
|
|
|
159
|
-
it
|
|
147
|
+
it 'outputs the scenario outline' do
|
|
160
148
|
lines = <<-OUTPUT
|
|
161
149
|
Given a multiline string:
|
|
162
150
|
"""
|
|
@@ -173,7 +161,7 @@ Feature: Banana party
|
|
|
173
161
|
end
|
|
174
162
|
end
|
|
175
163
|
|
|
176
|
-
describe
|
|
164
|
+
describe 'with a step with a py string' do
|
|
177
165
|
define_feature <<-FEATURE
|
|
178
166
|
Feature: Traveling circus
|
|
179
167
|
|
|
@@ -184,7 +172,7 @@ Feature: Banana party
|
|
|
184
172
|
"""
|
|
185
173
|
FEATURE
|
|
186
174
|
|
|
187
|
-
it
|
|
175
|
+
it 'displays the pystring nested' do
|
|
188
176
|
expect(@out.string).to include <<OUTPUT
|
|
189
177
|
"""
|
|
190
178
|
foo
|
|
@@ -193,7 +181,7 @@ OUTPUT
|
|
|
193
181
|
end
|
|
194
182
|
end
|
|
195
183
|
|
|
196
|
-
describe
|
|
184
|
+
describe 'with a multiline step arg' do
|
|
197
185
|
define_feature <<-FEATURE
|
|
198
186
|
Feature: Traveling circus
|
|
199
187
|
|
|
@@ -204,7 +192,7 @@ OUTPUT
|
|
|
204
192
|
| bar |
|
|
205
193
|
FEATURE
|
|
206
194
|
|
|
207
|
-
it
|
|
195
|
+
it 'displays the multiline string' do
|
|
208
196
|
expect(@out.string).to include <<OUTPUT
|
|
209
197
|
Given there are monkeys:
|
|
210
198
|
| name |
|
|
@@ -214,7 +202,7 @@ OUTPUT
|
|
|
214
202
|
end
|
|
215
203
|
end
|
|
216
204
|
|
|
217
|
-
describe
|
|
205
|
+
describe 'with a table in the background and the scenario' do
|
|
218
206
|
define_feature <<-FEATURE
|
|
219
207
|
Feature: accountant monkey
|
|
220
208
|
|
|
@@ -228,7 +216,7 @@ OUTPUT
|
|
|
228
216
|
| g | h |
|
|
229
217
|
FEATURE
|
|
230
218
|
|
|
231
|
-
it
|
|
219
|
+
it 'displays the table for the background' do
|
|
232
220
|
expect(@out.string).to include <<OUTPUT
|
|
233
221
|
Given table:
|
|
234
222
|
| a | b |
|
|
@@ -236,7 +224,7 @@ OUTPUT
|
|
|
236
224
|
OUTPUT
|
|
237
225
|
end
|
|
238
226
|
|
|
239
|
-
it
|
|
227
|
+
it 'displays the table for the scenario' do
|
|
240
228
|
expect(@out.string).to include <<OUTPUT
|
|
241
229
|
Given another table:
|
|
242
230
|
| e | f |
|
|
@@ -245,7 +233,7 @@ OUTPUT
|
|
|
245
233
|
end
|
|
246
234
|
end
|
|
247
235
|
|
|
248
|
-
describe
|
|
236
|
+
describe 'with a py string in the background and the scenario' do
|
|
249
237
|
define_feature <<-FEATURE
|
|
250
238
|
Feature: py strings
|
|
251
239
|
|
|
@@ -261,7 +249,7 @@ OUTPUT
|
|
|
261
249
|
"""
|
|
262
250
|
FEATURE
|
|
263
251
|
|
|
264
|
-
it
|
|
252
|
+
it 'displays the background py string' do
|
|
265
253
|
expect(@out.string).to include <<OUTPUT
|
|
266
254
|
Given stuff:
|
|
267
255
|
"""
|
|
@@ -270,7 +258,7 @@ OUTPUT
|
|
|
270
258
|
OUTPUT
|
|
271
259
|
end
|
|
272
260
|
|
|
273
|
-
it
|
|
261
|
+
it 'displays the scenario py string' do
|
|
274
262
|
expect(@out.string).to include <<OUTPUT
|
|
275
263
|
Given more stuff:
|
|
276
264
|
"""
|
|
@@ -280,7 +268,7 @@ OUTPUT
|
|
|
280
268
|
end
|
|
281
269
|
end
|
|
282
270
|
|
|
283
|
-
describe
|
|
271
|
+
describe 'with output from hooks' do
|
|
284
272
|
define_feature <<-FEATURE
|
|
285
273
|
Feature:
|
|
286
274
|
Scenario:
|
|
@@ -294,18 +282,18 @@ OUTPUT
|
|
|
294
282
|
|
|
295
283
|
define_steps do
|
|
296
284
|
Before do
|
|
297
|
-
puts
|
|
285
|
+
puts 'Before hook'
|
|
298
286
|
end
|
|
299
287
|
AfterStep do
|
|
300
|
-
puts
|
|
288
|
+
puts 'AfterStep hook'
|
|
301
289
|
end
|
|
302
290
|
After do
|
|
303
|
-
puts
|
|
291
|
+
puts 'After hook'
|
|
304
292
|
end
|
|
305
|
-
Given(
|
|
293
|
+
Given('this step passes') {}
|
|
306
294
|
end
|
|
307
295
|
|
|
308
|
-
it
|
|
296
|
+
it 'displays hook output appropriately ' do
|
|
309
297
|
expect( @out.string ).to include <<OUTPUT
|
|
310
298
|
Feature:
|
|
311
299
|
|
|
@@ -328,7 +316,7 @@ OUTPUT
|
|
|
328
316
|
end
|
|
329
317
|
end
|
|
330
318
|
|
|
331
|
-
describe
|
|
319
|
+
describe 'with background and output from hooks' do
|
|
332
320
|
define_feature <<-FEATURE
|
|
333
321
|
Feature:
|
|
334
322
|
Background:
|
|
@@ -339,18 +327,18 @@ OUTPUT
|
|
|
339
327
|
|
|
340
328
|
define_steps do
|
|
341
329
|
Before do
|
|
342
|
-
puts
|
|
330
|
+
puts 'Before hook'
|
|
343
331
|
end
|
|
344
332
|
AfterStep do
|
|
345
|
-
puts
|
|
333
|
+
puts 'AfterStep hook'
|
|
346
334
|
end
|
|
347
335
|
After do
|
|
348
|
-
puts
|
|
336
|
+
puts 'After hook'
|
|
349
337
|
end
|
|
350
|
-
Given(
|
|
338
|
+
Given('this step passes') {}
|
|
351
339
|
end
|
|
352
340
|
|
|
353
|
-
it
|
|
341
|
+
it 'displays hook output appropriately ' do
|
|
354
342
|
expect( @out.string ).to include <<OUTPUT
|
|
355
343
|
Feature:
|
|
356
344
|
|
|
@@ -370,7 +358,7 @@ OUTPUT
|
|
|
370
358
|
end
|
|
371
359
|
end
|
|
372
360
|
|
|
373
|
-
describe
|
|
361
|
+
describe 'with tags on all levels' do
|
|
374
362
|
define_feature <<-FEATURE
|
|
375
363
|
@tag1
|
|
376
364
|
Feature:
|
|
@@ -387,7 +375,7 @@ OUTPUT
|
|
|
387
375
|
FEATURE
|
|
388
376
|
|
|
389
377
|
|
|
390
|
-
it
|
|
378
|
+
it 'includes the tags in the output ' do
|
|
391
379
|
expect( @out.string ).to include <<OUTPUT
|
|
392
380
|
@tag1
|
|
393
381
|
Feature:
|
|
@@ -408,7 +396,7 @@ OUTPUT
|
|
|
408
396
|
end
|
|
409
397
|
end
|
|
410
398
|
|
|
411
|
-
describe
|
|
399
|
+
describe 'with comments on all levels' do
|
|
412
400
|
define_feature <<-FEATURE
|
|
413
401
|
#comment1
|
|
414
402
|
Feature:
|
|
@@ -435,7 +423,7 @@ OUTPUT
|
|
|
435
423
|
FEATURE
|
|
436
424
|
|
|
437
425
|
|
|
438
|
-
it
|
|
426
|
+
it 'includes the all comments except for data table rows in the output ' do
|
|
439
427
|
expect( @out.string ).to include <<OUTPUT
|
|
440
428
|
#comment1
|
|
441
429
|
Feature:
|
|
@@ -468,19 +456,19 @@ OUTPUT
|
|
|
468
456
|
end
|
|
469
457
|
end
|
|
470
458
|
|
|
471
|
-
context
|
|
459
|
+
context 'With --no-multiline passed as an option' do
|
|
472
460
|
before(:each) do
|
|
473
461
|
Cucumber::Term::ANSIColor.coloring = false
|
|
474
462
|
@out = StringIO.new
|
|
475
463
|
@formatter = Pretty.new(runtime, @out, {:no_multiline => true})
|
|
476
464
|
end
|
|
477
465
|
|
|
478
|
-
describe
|
|
466
|
+
describe 'given a single feature' do
|
|
479
467
|
before(:each) do
|
|
480
468
|
run_defined_feature
|
|
481
469
|
end
|
|
482
470
|
|
|
483
|
-
describe
|
|
471
|
+
describe 'with a scenario' do
|
|
484
472
|
define_feature <<-FEATURE
|
|
485
473
|
Feature: Banana party
|
|
486
474
|
|
|
@@ -488,16 +476,16 @@ OUTPUT
|
|
|
488
476
|
Given there are bananas
|
|
489
477
|
FEATURE
|
|
490
478
|
|
|
491
|
-
it
|
|
492
|
-
expect(@out.string).to include
|
|
479
|
+
it 'outputs the scenario name' do
|
|
480
|
+
expect(@out.string).to include 'Scenario: Monkey eats banana'
|
|
493
481
|
end
|
|
494
482
|
|
|
495
|
-
it
|
|
496
|
-
expect(@out.string).to include
|
|
483
|
+
it 'outputs the step' do
|
|
484
|
+
expect(@out.string).to include 'Given there are bananas'
|
|
497
485
|
end
|
|
498
486
|
end
|
|
499
487
|
|
|
500
|
-
describe
|
|
488
|
+
describe 'with a scenario outline' do
|
|
501
489
|
define_feature <<-FEATURE
|
|
502
490
|
Feature: Fud Pyramid
|
|
503
491
|
|
|
@@ -514,7 +502,7 @@ OUTPUT
|
|
|
514
502
|
| carrots |
|
|
515
503
|
FEATURE
|
|
516
504
|
|
|
517
|
-
it
|
|
505
|
+
it 'outputs the scenario outline' do
|
|
518
506
|
lines = <<-OUTPUT
|
|
519
507
|
Examples: Fruit
|
|
520
508
|
| Things |
|
|
@@ -530,16 +518,16 @@ OUTPUT
|
|
|
530
518
|
end
|
|
531
519
|
end
|
|
532
520
|
|
|
533
|
-
it
|
|
534
|
-
expect(@out.string).to include
|
|
521
|
+
it 'has 4 undefined scenarios' do
|
|
522
|
+
expect(@out.string).to include '4 scenarios (4 undefined)'
|
|
535
523
|
end
|
|
536
524
|
|
|
537
|
-
it
|
|
538
|
-
expect(@out.string).to include
|
|
525
|
+
it 'has 4 undefined steps' do
|
|
526
|
+
expect(@out.string).to include '4 steps (4 undefined)'
|
|
539
527
|
end
|
|
540
528
|
end
|
|
541
529
|
|
|
542
|
-
describe
|
|
530
|
+
describe 'with a step with a py string' do
|
|
543
531
|
define_feature <<-FEATURE
|
|
544
532
|
Feature: Traveling circus
|
|
545
533
|
|
|
@@ -550,7 +538,7 @@ OUTPUT
|
|
|
550
538
|
"""
|
|
551
539
|
FEATURE
|
|
552
540
|
|
|
553
|
-
it
|
|
541
|
+
it 'does not display the pystring' do
|
|
554
542
|
expect(@out.string).not_to include <<OUTPUT
|
|
555
543
|
"""
|
|
556
544
|
foo
|
|
@@ -559,7 +547,7 @@ OUTPUT
|
|
|
559
547
|
end
|
|
560
548
|
end
|
|
561
549
|
|
|
562
|
-
describe
|
|
550
|
+
describe 'with a multiline step arg' do
|
|
563
551
|
define_feature <<-FEATURE
|
|
564
552
|
Feature: Traveling circus
|
|
565
553
|
|
|
@@ -570,7 +558,7 @@ OUTPUT
|
|
|
570
558
|
| bar |
|
|
571
559
|
FEATURE
|
|
572
560
|
|
|
573
|
-
it
|
|
561
|
+
it 'does not display the multiline string' do
|
|
574
562
|
expect(@out.string).not_to include <<OUTPUT
|
|
575
563
|
| name |
|
|
576
564
|
| foo |
|
|
@@ -579,7 +567,7 @@ OUTPUT
|
|
|
579
567
|
end
|
|
580
568
|
end
|
|
581
569
|
|
|
582
|
-
describe
|
|
570
|
+
describe 'with a table in the background and the scenario' do
|
|
583
571
|
define_feature <<-FEATURE
|
|
584
572
|
Feature: accountant monkey
|
|
585
573
|
|
|
@@ -593,13 +581,13 @@ OUTPUT
|
|
|
593
581
|
| g | h |
|
|
594
582
|
FEATURE
|
|
595
583
|
|
|
596
|
-
it
|
|
584
|
+
it 'does not display the table for the background' do
|
|
597
585
|
expect(@out.string).not_to include <<OUTPUT
|
|
598
586
|
| a | b |
|
|
599
587
|
| c | d |
|
|
600
588
|
OUTPUT
|
|
601
589
|
end
|
|
602
|
-
it
|
|
590
|
+
it 'does not display the table for the scenario' do
|
|
603
591
|
expect(@out.string).not_to include <<OUTPUT
|
|
604
592
|
| e | f |
|
|
605
593
|
| g | h |
|
|
@@ -607,7 +595,7 @@ OUTPUT
|
|
|
607
595
|
end
|
|
608
596
|
end
|
|
609
597
|
|
|
610
|
-
describe
|
|
598
|
+
describe 'with a py string in the background and the scenario' do
|
|
611
599
|
define_feature <<-FEATURE
|
|
612
600
|
Feature: py strings
|
|
613
601
|
|
|
@@ -623,14 +611,14 @@ OUTPUT
|
|
|
623
611
|
"""
|
|
624
612
|
FEATURE
|
|
625
613
|
|
|
626
|
-
it
|
|
614
|
+
it 'does not display the background py string' do
|
|
627
615
|
expect(@out.string).not_to include <<OUTPUT
|
|
628
616
|
"""
|
|
629
617
|
foo
|
|
630
618
|
"""
|
|
631
619
|
OUTPUT
|
|
632
620
|
end
|
|
633
|
-
it
|
|
621
|
+
it 'does not display the scenario py string' do
|
|
634
622
|
expect(@out.string).not_to include <<OUTPUT
|
|
635
623
|
"""
|
|
636
624
|
bar
|
|
@@ -641,7 +629,7 @@ OUTPUT
|
|
|
641
629
|
end
|
|
642
630
|
end
|
|
643
631
|
|
|
644
|
-
context
|
|
632
|
+
context 'In --expand mode' do
|
|
645
633
|
let(:options) { { expand: true } }
|
|
646
634
|
before(:each) do
|
|
647
635
|
Cucumber::Term::ANSIColor.coloring = false
|
|
@@ -649,12 +637,12 @@ OUTPUT
|
|
|
649
637
|
@formatter = Pretty.new(runtime, @out, {})
|
|
650
638
|
end
|
|
651
639
|
|
|
652
|
-
describe
|
|
640
|
+
describe 'given a single feature' do
|
|
653
641
|
before(:each) do
|
|
654
642
|
run_defined_feature
|
|
655
643
|
end
|
|
656
644
|
|
|
657
|
-
describe
|
|
645
|
+
describe 'with a scenario outline' do
|
|
658
646
|
define_feature <<-FEATURE
|
|
659
647
|
Feature: Fud Pyramid
|
|
660
648
|
|
|
@@ -671,7 +659,7 @@ OUTPUT
|
|
|
671
659
|
| carrots |
|
|
672
660
|
FEATURE
|
|
673
661
|
|
|
674
|
-
it
|
|
662
|
+
it 'outputs the instantiated scenarios' do
|
|
675
663
|
lines = <<-OUTPUT
|
|
676
664
|
Examples: Fruit
|
|
677
665
|
Scenario: | apples |
|
|
@@ -690,7 +678,7 @@ OUTPUT
|
|
|
690
678
|
end
|
|
691
679
|
end
|
|
692
680
|
|
|
693
|
-
describe
|
|
681
|
+
describe 'with a scenario outline in en-lol' do
|
|
694
682
|
define_feature <<-FEATURE
|
|
695
683
|
# language: en-lol
|
|
696
684
|
OH HAI: STUFFING
|
|
@@ -706,7 +694,7 @@ OUTPUT
|
|
|
706
694
|
| 3 | 2 | 1 |
|
|
707
695
|
FEATURE
|
|
708
696
|
|
|
709
|
-
it
|
|
697
|
+
it 'outputs localized text' do
|
|
710
698
|
lines = <<-OUTPUT
|
|
711
699
|
OH HAI: STUFFING
|
|
712
700
|
|
|
@@ -730,7 +718,7 @@ OUTPUT
|
|
|
730
718
|
end
|
|
731
719
|
end
|
|
732
720
|
|
|
733
|
-
context
|
|
721
|
+
context 'In --expand mode with --source as an option' do
|
|
734
722
|
let(:options) { { expand: true } }
|
|
735
723
|
before(:each) do
|
|
736
724
|
Cucumber::Term::ANSIColor.coloring = false
|
|
@@ -738,12 +726,12 @@ OUTPUT
|
|
|
738
726
|
@formatter = Pretty.new(runtime, @out, {:source => true})
|
|
739
727
|
end
|
|
740
728
|
|
|
741
|
-
describe
|
|
729
|
+
describe 'given a single feature' do
|
|
742
730
|
before(:each) do
|
|
743
731
|
run_defined_feature
|
|
744
732
|
end
|
|
745
733
|
|
|
746
|
-
describe
|
|
734
|
+
describe 'with a scenario outline' do
|
|
747
735
|
define_feature <<-FEATURE
|
|
748
736
|
Feature: Fud Pyramid
|
|
749
737
|
|
|
@@ -760,7 +748,7 @@ OUTPUT
|
|
|
760
748
|
| carrots |
|
|
761
749
|
FEATURE
|
|
762
750
|
|
|
763
|
-
it
|
|
751
|
+
it 'includes the source in the output' do
|
|
764
752
|
lines = <<-OUTPUT
|
|
765
753
|
Scenario Outline: Monkey eats a balanced diet # spec.feature:3
|
|
766
754
|
Given there are <Things> # spec.feature:4
|
|
@@ -780,7 +768,7 @@ OUTPUT
|
|
|
780
768
|
end
|
|
781
769
|
end
|
|
782
770
|
|
|
783
|
-
context
|
|
771
|
+
context 'With very wide cells' do
|
|
784
772
|
define_feature <<-FEATURE
|
|
785
773
|
Feature: Monkey Business
|
|
786
774
|
|
|
@@ -792,7 +780,7 @@ OUTPUT
|
|
|
792
780
|
| Hominidae | Very long cell content |
|
|
793
781
|
FEATURE
|
|
794
782
|
|
|
795
|
-
it
|
|
783
|
+
it 'the scenario line controls the source indentation' do
|
|
796
784
|
lines = <<-OUTPUT
|
|
797
785
|
Examples:
|
|
798
786
|
Scenario: | Hominidae | Very long cell content | # spec.feature:8
|
|
@@ -808,7 +796,7 @@ OUTPUT
|
|
|
808
796
|
end
|
|
809
797
|
end
|
|
810
798
|
|
|
811
|
-
context
|
|
799
|
+
context 'snippets contain relevant keyword replacements' do
|
|
812
800
|
|
|
813
801
|
before(:each) do
|
|
814
802
|
Cucumber::Term::ANSIColor.coloring = false
|
|
@@ -817,7 +805,7 @@ OUTPUT
|
|
|
817
805
|
run_defined_feature
|
|
818
806
|
end
|
|
819
807
|
|
|
820
|
-
describe
|
|
808
|
+
describe 'With a scenario that has undefined steps' do
|
|
821
809
|
define_feature <<-FEATURE
|
|
822
810
|
Feature: Banana party
|
|
823
811
|
|
|
@@ -831,12 +819,12 @@ OUTPUT
|
|
|
831
819
|
FEATURE
|
|
832
820
|
|
|
833
821
|
it "containes snippets with 'And' or 'But' replaced by previous step name" do
|
|
834
|
-
expect(@out.string).to include(
|
|
835
|
-
expect(@out.string).to include(
|
|
836
|
-
expect(@out.string).to include(
|
|
837
|
-
expect(@out.string).to include(
|
|
838
|
-
expect(@out.string).to include(
|
|
839
|
-
expect(@out.string).to include(
|
|
822
|
+
expect(@out.string).to include('Given("there are bananas and apples")')
|
|
823
|
+
expect(@out.string).to include('Given("other monkeys are around")')
|
|
824
|
+
expect(@out.string).to include('When("one monkey eats a banana")')
|
|
825
|
+
expect(@out.string).to include('When("the other monkeys eat all the apples")')
|
|
826
|
+
expect(@out.string).to include('Then("bananas remain")')
|
|
827
|
+
expect(@out.string).to include('Then("there are no apples left")')
|
|
840
828
|
end
|
|
841
829
|
end
|
|
842
830
|
|
|
@@ -853,12 +841,12 @@ OUTPUT
|
|
|
853
841
|
* there are no apples left
|
|
854
842
|
FEATURE
|
|
855
843
|
it "replaces the first step with 'Given'" do
|
|
856
|
-
expect(@out.string).to include(
|
|
844
|
+
expect(@out.string).to include('Given("there are bananas and apples")')
|
|
857
845
|
end
|
|
858
846
|
it "uses actual keywords as the 'previous' keyword for future replacements" do
|
|
859
|
-
expect(@out.string).to include(
|
|
860
|
-
expect(@out.string).to include(
|
|
861
|
-
expect(@out.string).to include(
|
|
847
|
+
expect(@out.string).to include('Given("other monkeys are around")')
|
|
848
|
+
expect(@out.string).to include('When("the other monkeys eat all the apples")')
|
|
849
|
+
expect(@out.string).to include('Then("there are no apples left")')
|
|
862
850
|
end
|
|
863
851
|
end
|
|
864
852
|
|
|
@@ -872,10 +860,10 @@ OUTPUT
|
|
|
872
860
|
And this step is undefined
|
|
873
861
|
FEATURE
|
|
874
862
|
define_steps do
|
|
875
|
-
Given(
|
|
863
|
+
Given('this step passes') {}
|
|
876
864
|
end
|
|
877
|
-
it
|
|
878
|
-
expect(@out.string).to include(
|
|
865
|
+
it 'uses actual keyword of the previous passing step for the undefined step' do
|
|
866
|
+
expect(@out.string).to include('Then("this step is undefined")')
|
|
879
867
|
end
|
|
880
868
|
end
|
|
881
869
|
|
|
@@ -892,15 +880,15 @@ OUTPUT
|
|
|
892
880
|
Then this step passes
|
|
893
881
|
FEATURE
|
|
894
882
|
define_steps do
|
|
895
|
-
Given(
|
|
883
|
+
Given('this step passes') {}
|
|
896
884
|
end
|
|
897
885
|
it "uses 'Given' as actual keyword the step in each scenario" do
|
|
898
|
-
expect(@out.string).to include(
|
|
899
|
-
expect(@out.string).to include(
|
|
886
|
+
expect(@out.string).to include('Given("this step is undefined")')
|
|
887
|
+
expect(@out.string).to include('Given("this step is also undefined")')
|
|
900
888
|
end
|
|
901
889
|
end
|
|
902
890
|
|
|
903
|
-
describe
|
|
891
|
+
describe 'with a scenario in en-lol' do
|
|
904
892
|
define_feature <<-FEATURE
|
|
905
893
|
# language: en-lol
|
|
906
894
|
OH HAI: STUFFING
|
|
@@ -909,8 +897,8 @@ OUTPUT
|
|
|
909
897
|
I CAN HAZ IN TEH BEGINNIN CUCUMBRZ
|
|
910
898
|
AN I EAT CUCUMBRZ
|
|
911
899
|
FEATURE
|
|
912
|
-
it
|
|
913
|
-
expect(@out.string).to include(
|
|
900
|
+
it 'uses actual keyword of the previous passing step for the undefined step' do
|
|
901
|
+
expect(@out.string).to include('ICANHAZ("I EAT CUCUMBRZ")')
|
|
914
902
|
end
|
|
915
903
|
end
|
|
916
904
|
end
|