cucumber 2.99.0 → 3.0.0.pre.1
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/.travis.yml +22 -10
- data/CONTRIBUTING.md +13 -0
- data/Gemfile +11 -4
- data/History.md +19 -1
- data/README.md +1 -1
- data/cucumber.gemspec +2 -2
- data/cucumber.yml +2 -2
- data/features/docs/api/listen_for_events.feature +7 -6
- data/features/docs/cli/help.feature +8 -0
- data/features/docs/cli/retry_failing_tests.feature +51 -16
- data/features/docs/defining_steps/nested_steps_i18n.feature +2 -0
- data/features/docs/defining_steps/printing_messages.feature +0 -1
- data/features/docs/defining_steps/skip_scenario.feature +0 -34
- data/features/docs/extending_cucumber/custom_formatter.feature +2 -30
- data/features/docs/formatters/summary_formatter.feature +34 -0
- data/features/docs/gherkin/unicode_table.feature +1 -1
- data/features/docs/post_configuration_hook.feature +0 -16
- data/features/docs/writing_support_code/world.feature +129 -0
- data/features/lib/step_definitions/aruba_steps.rb +1 -0
- data/features/lib/step_definitions/cli_steps.rb +4 -0
- data/features/lib/step_definitions/cucumber_steps.rb +1 -0
- data/features/lib/step_definitions/iso-8859-1_steps.rb +1 -0
- data/features/lib/step_definitions/json_steps.rb +1 -0
- data/features/lib/step_definitions/junit_steps.rb +1 -0
- data/features/lib/step_definitions/language_steps.rb +1 -0
- data/features/lib/step_definitions/profile_steps.rb +1 -0
- data/features/lib/step_definitions/retry_steps.rb +32 -12
- data/features/lib/step_definitions/ruby_steps.rb +1 -0
- data/features/lib/step_definitions/wire_steps.rb +1 -0
- data/features/lib/support/env.rb +2 -1
- data/features/lib/support/fake_wire_server.rb +1 -0
- data/features/lib/support/feature_factory.rb +1 -0
- data/features/lib/support/normalise_output.rb +1 -0
- data/gem_tasks/contributors.rake +1 -0
- data/gem_tasks/cov.rake +1 -0
- data/gem_tasks/cucumber.rake +1 -0
- data/gem_tasks/downloads.rb +1 -0
- data/gem_tasks/environment.rake +1 -0
- data/gem_tasks/examples.rake +2 -1
- data/gem_tasks/fix_cr_lf.rake +2 -1
- data/gem_tasks/flog.rake +2 -1
- data/gem_tasks/rspec.rake +1 -0
- data/gem_tasks/sass.rake +2 -1
- data/lib/autotest/cucumber.rb +1 -0
- data/lib/autotest/cucumber_mixin.rb +1 -0
- 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 +1 -0
- data/lib/cucumber.rb +1 -13
- data/lib/cucumber/cli/configuration.rb +3 -6
- data/lib/cucumber/cli/main.rb +2 -1
- data/lib/cucumber/cli/options.rb +239 -173
- data/lib/cucumber/cli/profile_loader.rb +1 -0
- data/lib/cucumber/cli/rerun_file.rb +1 -0
- data/lib/cucumber/configuration.rb +40 -19
- data/lib/cucumber/constantize.rb +1 -0
- data/lib/cucumber/core_ext/instance_exec.rb +1 -0
- data/lib/cucumber/core_ext/string.rb +1 -0
- data/lib/cucumber/deprecate.rb +1 -0
- data/lib/cucumber/encoding.rb +1 -0
- data/lib/cucumber/errors.rb +3 -1
- data/lib/cucumber/events.rb +13 -3
- data/lib/cucumber/events/step_definition_registered.rb +24 -0
- data/lib/cucumber/events/step_match.rb +4 -1
- data/lib/cucumber/events/test_run_finished.rb +12 -0
- data/lib/cucumber/file_specs.rb +1 -0
- data/lib/cucumber/filters.rb +2 -0
- data/lib/cucumber/filters/activate_steps.rb +2 -1
- 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/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 +3 -3
- data/lib/cucumber/filters/tag_limits.rb +1 -0
- data/lib/cucumber/filters/tag_limits/test_case_index.rb +1 -0
- data/lib/cucumber/filters/tag_limits/verifier.rb +1 -0
- data/lib/cucumber/formatter/ansicolor.rb +1 -0
- data/lib/cucumber/formatter/backtrace_filter.rb +3 -2
- data/lib/cucumber/formatter/console.rb +61 -52
- data/lib/cucumber/formatter/console_counts.rb +57 -0
- data/lib/cucumber/formatter/console_issues.rb +37 -0
- data/lib/cucumber/formatter/debug.rb +1 -0
- data/lib/cucumber/formatter/duration.rb +1 -0
- 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 +6 -5
- data/lib/cucumber/formatter/ignore_missing_messages.rb +1 -0
- data/lib/cucumber/formatter/interceptor.rb +1 -0
- data/lib/cucumber/formatter/io.rb +1 -0
- data/lib/cucumber/formatter/json.rb +15 -13
- data/lib/cucumber/formatter/json_pretty.rb +1 -0
- data/lib/cucumber/formatter/junit.rb +13 -11
- data/lib/cucumber/formatter/legacy_api/adapter.rb +28 -32
- data/lib/cucumber/formatter/legacy_api/ast.rb +1 -0
- data/lib/cucumber/formatter/legacy_api/results.rb +1 -0
- data/lib/cucumber/formatter/legacy_api/runtime_facade.rb +1 -0
- data/lib/cucumber/formatter/pretty.rb +7 -1
- data/lib/cucumber/formatter/progress.rb +56 -13
- data/lib/cucumber/formatter/rerun.rb +15 -18
- data/lib/cucumber/formatter/stepdefs.rb +1 -0
- data/lib/cucumber/formatter/steps.rb +1 -0
- data/lib/cucumber/formatter/summary.rb +43 -20
- data/lib/cucumber/formatter/unicode.rb +1 -0
- data/lib/cucumber/formatter/usage.rb +26 -21
- data/lib/cucumber/gherkin/data_table_parser.rb +1 -0
- data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +1 -0
- data/lib/cucumber/gherkin/formatter/escaping.rb +1 -0
- data/lib/cucumber/gherkin/i18n.rb +1 -0
- data/lib/cucumber/gherkin/steps_parser.rb +1 -0
- data/lib/cucumber/hooks.rb +1 -0
- data/lib/cucumber/load_path.rb +1 -0
- data/lib/cucumber/multiline_argument.rb +1 -2
- data/lib/cucumber/multiline_argument/data_table.rb +3 -1
- data/lib/cucumber/multiline_argument/doc_string.rb +1 -0
- data/lib/cucumber/platform.rb +1 -0
- data/lib/cucumber/project_initializer.rb +2 -1
- data/lib/cucumber/rake/task.rb +1 -0
- data/lib/cucumber/rb_support/rb_dsl.rb +11 -9
- data/lib/cucumber/rb_support/rb_hook.rb +1 -0
- data/lib/cucumber/rb_support/rb_language.rb +19 -8
- data/lib/cucumber/rb_support/rb_step_definition.rb +1 -0
- data/lib/cucumber/rb_support/rb_transform.rb +1 -0
- data/lib/cucumber/rb_support/rb_world.rb +42 -20
- data/lib/cucumber/rb_support/snippet.rb +2 -1
- data/lib/cucumber/rspec/disable_option_parser.rb +1 -0
- data/lib/cucumber/rspec/doubles.rb +1 -0
- data/lib/cucumber/running_test_case.rb +1 -25
- data/lib/cucumber/runtime.rb +15 -10
- data/lib/cucumber/runtime/after_hooks.rb +1 -0
- data/lib/cucumber/runtime/before_hooks.rb +1 -0
- data/lib/cucumber/runtime/for_programming_languages.rb +1 -0
- data/lib/cucumber/runtime/step_hooks.rb +1 -0
- data/lib/cucumber/runtime/support_code.rb +1 -0
- data/lib/cucumber/runtime/user_interface.rb +1 -0
- data/lib/cucumber/step_argument.rb +1 -0
- data/lib/cucumber/step_definition_light.rb +1 -0
- data/lib/cucumber/step_definitions.rb +1 -0
- data/lib/cucumber/step_match.rb +1 -0
- data/lib/cucumber/step_match_search.rb +1 -0
- data/lib/cucumber/term/ansicolor.rb +1 -0
- data/lib/cucumber/unit.rb +1 -0
- data/lib/cucumber/version +1 -1
- data/lib/simplecov_setup.rb +1 -0
- data/spec/cucumber/cli/configuration_spec.rb +1 -0
- data/spec/cucumber/cli/main_spec.rb +1 -0
- data/spec/cucumber/cli/options_spec.rb +1 -0
- data/spec/cucumber/cli/profile_loader_spec.rb +1 -0
- data/spec/cucumber/cli/rerun_spec.rb +1 -0
- data/spec/cucumber/configuration_spec.rb +1 -0
- data/spec/cucumber/constantize_spec.rb +1 -0
- data/spec/cucumber/core_ext/instance_exec_spec.rb +1 -0
- data/spec/cucumber/file_specs_spec.rb +1 -0
- data/spec/cucumber/filters/activate_steps_spec.rb +9 -6
- data/spec/cucumber/filters/gated_receiver_spec.rb +1 -0
- data/spec/cucumber/filters/retry_spec.rb +27 -21
- data/spec/cucumber/filters/tag_limits/test_case_index_spec.rb +1 -0
- data/spec/cucumber/filters/tag_limits/verifier_spec.rb +1 -0
- data/spec/cucumber/filters/tag_limits_spec.rb +1 -0
- data/spec/cucumber/formatter/ansicolor_spec.rb +1 -0
- data/spec/cucumber/formatter/console_counts_spec.rb +14 -0
- data/spec/cucumber/formatter/debug_spec.rb +1 -0
- data/spec/cucumber/formatter/duration_spec.rb +1 -0
- data/spec/cucumber/formatter/fail_fast_spec.rb +5 -5
- data/spec/cucumber/formatter/html_spec.rb +6 -1
- data/spec/cucumber/formatter/interceptor_spec.rb +1 -0
- data/spec/cucumber/formatter/json_spec.rb +29 -28
- data/spec/cucumber/formatter/junit_spec.rb +1 -0
- data/spec/cucumber/formatter/legacy_api/adapter_spec.rb +8 -3
- data/spec/cucumber/formatter/pretty_spec.rb +1 -0
- data/spec/cucumber/formatter/progress_spec.rb +2 -1
- data/spec/cucumber/formatter/rerun_spec.rb +70 -64
- data/spec/cucumber/formatter/spec_helper.rb +8 -7
- data/spec/cucumber/hooks_spec.rb +1 -0
- data/spec/cucumber/multiline_argument/data_table_spec.rb +1 -0
- data/spec/cucumber/project_initializer_spec.rb +2 -1
- data/spec/cucumber/rake/forked_spec.rb +1 -0
- data/spec/cucumber/rake/task_spec.rb +1 -0
- data/spec/cucumber/rb_support/rb_language_spec.rb +81 -3
- data/spec/cucumber/rb_support/rb_step_definition_spec.rb +1 -0
- data/spec/cucumber/rb_support/rb_transform_spec.rb +1 -0
- data/spec/cucumber/rb_support/rb_world_spec.rb +2 -1
- data/spec/cucumber/rb_support/snippet_spec.rb +1 -0
- data/spec/cucumber/running_test_case_spec.rb +1 -0
- data/spec/cucumber/runtime/for_programming_languages_spec.rb +1 -0
- data/spec/cucumber/runtime/support_code_spec.rb +1 -0
- data/spec/cucumber/runtime_spec.rb +1 -0
- data/spec/cucumber/step_argument_spec.rb +1 -0
- data/spec/cucumber/step_match_search_spec.rb +1 -0
- data/spec/cucumber/step_match_spec.rb +1 -0
- data/spec/cucumber/world/pending_spec.rb +1 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/standard_step_actions.rb +1 -0
- metadata +24 -23
- data/lib/cucumber/ast.rb +0 -13
- 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/event_bus_report.rb +0 -38
- data/spec/cucumber/events/bus_spec.rb +0 -94
- data/spec/cucumber/formatter/event_bus_report_spec.rb +0 -88
- data/spec/cucumber_spec.rb +0 -39
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Cucumber
|
2
3
|
module RbSupport
|
3
4
|
# This module defines the methods you can use to define pure Ruby
|
@@ -11,8 +12,8 @@ module Cucumber
|
|
11
12
|
alias_method adverb, :register_rb_step_definition
|
12
13
|
end
|
13
14
|
|
14
|
-
def build_rb_world_factory(world_modules, proc)
|
15
|
-
@rb_language.build_rb_world_factory(world_modules, proc)
|
15
|
+
def build_rb_world_factory(world_modules, namespaced_world_modules, proc)
|
16
|
+
@rb_language.build_rb_world_factory(world_modules, namespaced_world_modules, proc)
|
16
17
|
end
|
17
18
|
|
18
19
|
def register_rb_hook(phase, tag_names, proc)
|
@@ -33,6 +34,10 @@ module Cucumber
|
|
33
34
|
# Object that the scenario's steps will run within. Any +world_modules+
|
34
35
|
# will be mixed into this Object (via Object#extend).
|
35
36
|
#
|
37
|
+
# By default the +world modules+ are added to a global namespace. It is
|
38
|
+
# possible to create a namespaced World by using an hash, where the
|
39
|
+
# symbols are the namespaces.
|
40
|
+
#
|
36
41
|
# This method is typically called from one or more Ruby scripts under
|
37
42
|
# <tt>features/support</tt>. You can call this method as many times as you
|
38
43
|
# like (to register more modules), but if you try to register more than
|
@@ -46,8 +51,10 @@ module Cucumber
|
|
46
51
|
#
|
47
52
|
# World(MyModule)
|
48
53
|
#
|
49
|
-
|
50
|
-
|
54
|
+
# World(my_module: MyModule)
|
55
|
+
#
|
56
|
+
def World(*world_modules, **namespaced_world_modules, &proc)
|
57
|
+
RbDsl.build_rb_world_factory(world_modules, namespaced_world_modules, proc)
|
51
58
|
end
|
52
59
|
|
53
60
|
# Registers a proc that will run before each Scenario. You can register as many
|
@@ -83,11 +90,6 @@ module Cucumber
|
|
83
90
|
# provided proc. The return value of the proc is consequently yielded to the
|
84
91
|
# step definition.
|
85
92
|
def Transform(regexp, &proc)
|
86
|
-
Cucumber.deprecate(
|
87
|
-
"\n Please follow the upgrade instructions at https://cucumber.io/blog/2017/09/21/upgrading-to-cucumber-3",
|
88
|
-
"Transform",
|
89
|
-
"3.0.0"
|
90
|
-
)
|
91
93
|
RbDsl.register_rb_transform(regexp, proc)
|
92
94
|
end
|
93
95
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'cucumber/core_ext/instance_exec'
|
2
3
|
require 'cucumber/rb_support/rb_dsl'
|
3
4
|
require 'cucumber/rb_support/rb_world'
|
@@ -9,6 +10,7 @@ require 'cucumber/gherkin/i18n'
|
|
9
10
|
require 'multi_test'
|
10
11
|
require 'cucumber/step_match'
|
11
12
|
require 'cucumber/step_definition_light'
|
13
|
+
require 'cucumber/events/step_definition_registered'
|
12
14
|
|
13
15
|
module Cucumber
|
14
16
|
module RbSupport
|
@@ -22,7 +24,8 @@ module Cucumber
|
|
22
24
|
# Raised if there are 2 or more World blocks.
|
23
25
|
class MultipleWorld < StandardError
|
24
26
|
def initialize(first_proc, second_proc)
|
25
|
-
message =
|
27
|
+
message = String.new
|
28
|
+
message << "You can only pass a proc to #World once, but it's happening\n"
|
26
29
|
message << "in 2 places:\n\n"
|
27
30
|
message << RbSupport.backtrace_line(first_proc, 'World') << "\n"
|
28
31
|
message << RbSupport.backtrace_line(second_proc, 'World') << "\n\n"
|
@@ -46,11 +49,11 @@ module Cucumber
|
|
46
49
|
end
|
47
50
|
|
48
51
|
def initialize(runtime, configuration)
|
49
|
-
@runtime = runtime
|
52
|
+
@runtime, @configuration = runtime, configuration
|
50
53
|
@step_definitions = []
|
51
54
|
RbDsl.rb_language = self
|
52
55
|
@world_proc = @world_modules = nil
|
53
|
-
configuration.register_snippet_generator(Snippet::Generator.new)
|
56
|
+
@configuration.register_snippet_generator(Snippet::Generator.new)
|
54
57
|
end
|
55
58
|
|
56
59
|
def step_matches(name_to_match)
|
@@ -79,16 +82,24 @@ module Cucumber
|
|
79
82
|
def register_rb_step_definition(regexp, proc_or_sym, options)
|
80
83
|
step_definition = RbStepDefinition.new(self, regexp, proc_or_sym, options)
|
81
84
|
@step_definitions << step_definition
|
85
|
+
@configuration.notify :step_definition_registered, step_definition
|
82
86
|
step_definition
|
83
87
|
end
|
84
88
|
|
85
|
-
def build_rb_world_factory(world_modules, proc)
|
86
|
-
if
|
89
|
+
def build_rb_world_factory(world_modules, namespaced_world_modules, proc)
|
90
|
+
if proc
|
87
91
|
raise MultipleWorld.new(@world_proc, proc) if @world_proc
|
88
92
|
@world_proc = proc
|
89
93
|
end
|
90
94
|
@world_modules ||= []
|
91
95
|
@world_modules += world_modules
|
96
|
+
|
97
|
+
@namespaced_world_modules ||= Hash.new { |h, k| h[k] = [] }
|
98
|
+
namespaced_world_modules.each do |namespace, world_module|
|
99
|
+
unless @namespaced_world_modules[namespace].include?(world_module)
|
100
|
+
@namespaced_world_modules[namespace] << world_module
|
101
|
+
end
|
102
|
+
end
|
92
103
|
end
|
93
104
|
|
94
105
|
def load_code_file(code_file)
|
@@ -177,9 +188,9 @@ module Cucumber
|
|
177
188
|
def extend_world
|
178
189
|
@current_world.extend(RbWorld)
|
179
190
|
MultiTest.extend_with_best_assertion_library(@current_world)
|
180
|
-
|
181
|
-
|
182
|
-
|
191
|
+
|
192
|
+
@current_world.add_modules!(@world_modules || [],
|
193
|
+
@namespaced_world_modules || {})
|
183
194
|
end
|
184
195
|
|
185
196
|
def connect_world(scenario)
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'cucumber/gherkin/formatter/ansi_escapes'
|
2
3
|
|
3
4
|
module Cucumber
|
@@ -20,6 +21,12 @@ module Cucumber
|
|
20
21
|
# @private
|
21
22
|
attr_writer :__cucumber_runtime, :__natural_language
|
22
23
|
|
24
|
+
# Extend the World with user-defined modules
|
25
|
+
def add_modules!(world_modules, namespaced_world_modules)
|
26
|
+
add_world_modules!(world_modules)
|
27
|
+
add_namespaced_modules!(namespaced_world_modules)
|
28
|
+
end
|
29
|
+
|
23
30
|
# Run a single Gherkin step
|
24
31
|
# @example Call another step
|
25
32
|
# step "I am logged in"
|
@@ -66,26 +73,6 @@ module Cucumber
|
|
66
73
|
@__cucumber_runtime.table(text_or_table, file, line_offset)
|
67
74
|
end
|
68
75
|
|
69
|
-
# Create an {Cucumber::Ast::DocString} object
|
70
|
-
#
|
71
|
-
# Useful in conjunction with the #step method, when
|
72
|
-
# want to specify a content type.
|
73
|
-
# @example Create a multiline string
|
74
|
-
# code = multiline_string(%{
|
75
|
-
# puts "this is ruby code"
|
76
|
-
# %}, 'ruby')
|
77
|
-
def doc_string(string_without_triple_quotes, content_type='', line_offset=0)
|
78
|
-
STDERR.puts AnsiEscapes.failed + "WARNING: #doc_string is deprecated. Just pass a regular String instead:" + caller[0] + AnsiEscapes.reset
|
79
|
-
# TODO: rename this method to multiline_string
|
80
|
-
@__cucumber_runtime.doc_string(string_without_triple_quotes, content_type, line_offset)
|
81
|
-
end
|
82
|
-
|
83
|
-
# @deprecated Use {#puts} instead.
|
84
|
-
def announce(*messages)
|
85
|
-
STDERR.puts AnsiEscapes.failed + "WARNING: #announce is deprecated. Use #puts instead:" + caller[0] + AnsiEscapes.reset
|
86
|
-
puts(*messages)
|
87
|
-
end
|
88
|
-
|
89
76
|
# Print a message to the output.
|
90
77
|
#
|
91
78
|
# @note Cucumber might surprise you with the behaviour of this method. Instead
|
@@ -137,6 +124,7 @@ module Cucumber
|
|
137
124
|
(class << self; self; end).instance_eval do
|
138
125
|
modules += included_modules
|
139
126
|
end
|
127
|
+
modules << stringify_namespaced_modules
|
140
128
|
sprintf("#<%s:0x%x>", modules.join('+'), self.object_id)
|
141
129
|
end
|
142
130
|
|
@@ -144,6 +132,40 @@ module Cucumber
|
|
144
132
|
def to_s
|
145
133
|
inspect
|
146
134
|
end
|
135
|
+
|
136
|
+
private
|
137
|
+
|
138
|
+
# @private
|
139
|
+
def add_world_modules!(modules)
|
140
|
+
modules.each do |world_module|
|
141
|
+
extend(world_module)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# @private
|
146
|
+
def add_namespaced_modules!(modules)
|
147
|
+
@__namespaced_modules = modules
|
148
|
+
modules.each do |namespace, world_modules|
|
149
|
+
world_modules.each do |world_module|
|
150
|
+
variable_name = "@__#{namespace}_world"
|
151
|
+
|
152
|
+
inner_world = if self.class.respond_to?(namespace)
|
153
|
+
instance_variable_get(variable_name)
|
154
|
+
else
|
155
|
+
Object.new
|
156
|
+
end
|
157
|
+
instance_variable_set(variable_name,
|
158
|
+
inner_world.extend(world_module))
|
159
|
+
self.class.send(:define_method, namespace) do
|
160
|
+
instance_variable_get(variable_name)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
def stringify_namespaced_modules
|
167
|
+
@__namespaced_modules.map { |k, v| "#{v.join(',')} (as #{k})" }.join('+')
|
168
|
+
end
|
147
169
|
end
|
148
170
|
end
|
149
171
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Cucumber
|
2
3
|
module RbSupport
|
3
4
|
module Snippet
|
@@ -56,7 +57,7 @@ module Cucumber
|
|
56
57
|
end
|
57
58
|
|
58
59
|
def do_block
|
59
|
-
do_block =
|
60
|
+
do_block = String.new
|
60
61
|
do_block << "do#{arguments}\n"
|
61
62
|
multiline_argument.append_comment_to(do_block)
|
62
63
|
do_block << " pending # Write code here that turns the phrase above into concrete actions\n"
|
@@ -1,5 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'delegate'
|
2
|
-
require 'cucumber/deprecate'
|
3
3
|
|
4
4
|
module Cucumber
|
5
5
|
# Represents the current status of a running test case.
|
@@ -80,34 +80,10 @@ module Cucumber
|
|
80
80
|
!failed?
|
81
81
|
end
|
82
82
|
|
83
|
-
def title
|
84
|
-
Cucumber.deprecate(
|
85
|
-
"Call #name instead",
|
86
|
-
"RunningTestCase#title",
|
87
|
-
"2.9.9")
|
88
|
-
name
|
89
|
-
end
|
90
|
-
|
91
|
-
def source_tags
|
92
|
-
Cucumber.deprecate(
|
93
|
-
"Call #tags instead",
|
94
|
-
"RunningTestCase#source_tags",
|
95
|
-
"2.9.9")
|
96
|
-
tags
|
97
|
-
end
|
98
|
-
|
99
83
|
def source_tag_names
|
100
84
|
tags.map &:name
|
101
85
|
end
|
102
86
|
|
103
|
-
def skip_invoke!
|
104
|
-
Cucumber.deprecate(
|
105
|
-
"Call #skip_this_scenario directly (not on any object)",
|
106
|
-
"RunningTestCase#skip_invoke!",
|
107
|
-
"2.9.9")
|
108
|
-
raise Cucumber::Core::Test::Result::Skipped
|
109
|
-
end
|
110
|
-
|
111
87
|
def outline?
|
112
88
|
false
|
113
89
|
end
|
data/lib/cucumber/runtime.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
+
# frozen_string_literal: true
|
2
3
|
require 'fileutils'
|
3
4
|
require 'multi_json'
|
4
5
|
require 'cucumber/configuration'
|
@@ -7,7 +8,6 @@ require 'cucumber/formatter/duration'
|
|
7
8
|
require 'cucumber/file_specs'
|
8
9
|
require 'cucumber/filters'
|
9
10
|
require 'cucumber/formatter/fanout'
|
10
|
-
require 'cucumber/formatter/event_bus_report'
|
11
11
|
require 'cucumber/gherkin/i18n'
|
12
12
|
require 'cucumber/step_match_search'
|
13
13
|
|
@@ -58,13 +58,16 @@ module Cucumber
|
|
58
58
|
|
59
59
|
require 'cucumber/wire/plugin'
|
60
60
|
def run!
|
61
|
-
load_step_definitions
|
62
61
|
install_wire_plugin
|
62
|
+
load_support_files
|
63
63
|
fire_after_configuration_hook
|
64
|
+
formatters
|
65
|
+
load_step_definitions
|
64
66
|
self.visitor = report
|
65
67
|
|
66
|
-
receiver = Test::Runner.new(
|
68
|
+
receiver = Test::Runner.new(@configuration.event_bus)
|
67
69
|
compile features, receiver, filters
|
70
|
+
@configuration.notify :test_run_finished
|
68
71
|
end
|
69
72
|
|
70
73
|
def features_paths
|
@@ -169,17 +172,13 @@ module Cucumber
|
|
169
172
|
require 'cucumber/core/report/summary'
|
170
173
|
def report
|
171
174
|
return @report if @report
|
172
|
-
reports = [summary_report
|
175
|
+
reports = [summary_report] + formatters
|
173
176
|
reports << fail_fast_report if @configuration.fail_fast?
|
174
177
|
@report ||= Formatter::Fanout.new(reports)
|
175
178
|
end
|
176
179
|
|
177
180
|
def summary_report
|
178
|
-
@summary_report ||= Core::Report::Summary.new
|
179
|
-
end
|
180
|
-
|
181
|
-
def event_bus_report
|
182
|
-
@event_bus_report ||= Formatter::EventBusReport.new(@configuration)
|
181
|
+
@summary_report ||= Core::Report::Summary.new(@configuration.event_bus)
|
183
182
|
end
|
184
183
|
|
185
184
|
def fail_fast_report
|
@@ -231,6 +230,7 @@ module Cucumber
|
|
231
230
|
filters << Cucumber::Core::Test::LocationsFilter.new(filespecs.locations)
|
232
231
|
filters << Filters::Randomizer.new(@configuration.seed) if @configuration.randomize?
|
233
232
|
filters << Filters::Quit.new
|
233
|
+
filters << Filters::Retry.new(@configuration)
|
234
234
|
# TODO: can we just use RbLanguages's step definitions directly?
|
235
235
|
step_match_search = StepMatchSearch.new(@support_code.ruby.method(:step_matches), @configuration)
|
236
236
|
filters << Filters::ActivateSteps.new(step_match_search, @configuration)
|
@@ -248,8 +248,13 @@ module Cucumber
|
|
248
248
|
end
|
249
249
|
end
|
250
250
|
|
251
|
+
def load_support_files
|
252
|
+
files = @configuration.support_to_load
|
253
|
+
@support_code.load_files!(files)
|
254
|
+
end
|
255
|
+
|
251
256
|
def load_step_definitions
|
252
|
-
files = @configuration.
|
257
|
+
files = @configuration.step_defs_to_load
|
253
258
|
@support_code.load_files!(files)
|
254
259
|
end
|
255
260
|
|
data/lib/cucumber/step_match.rb
CHANGED