cucumber 2.99.0 → 3.0.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -4,22 +4,6 @@ Feature: Post Configuration Hook [#423]
|
|
4
4
|
As a developer
|
5
5
|
I want to manipulate the Cucumber configuration after it has been created
|
6
6
|
|
7
|
-
# Fails on Travis under JRuby
|
8
|
-
@spawn
|
9
|
-
@wip-jruby
|
10
|
-
Scenario: Using options directly gets a deprecation warning
|
11
|
-
Given a file named "features/support/env.rb" with:
|
12
|
-
"""
|
13
|
-
AfterConfiguration do |config|
|
14
|
-
config.options[:blah]
|
15
|
-
end
|
16
|
-
"""
|
17
|
-
When I run `cucumber features`
|
18
|
-
Then the stderr should contain:
|
19
|
-
"""
|
20
|
-
Deprecated
|
21
|
-
"""
|
22
|
-
|
23
7
|
Scenario: Changing the output format
|
24
8
|
Given a file named "features/support/env.rb" with:
|
25
9
|
"""
|
@@ -0,0 +1,129 @@
|
|
1
|
+
Feature: World
|
2
|
+
|
3
|
+
In order to isolate each test scenario, the steps definitions belonging to the
|
4
|
+
same scenario will run in a isolated context, called 'world'. A world also
|
5
|
+
contains the helpers methods that will be used in the step definitions.
|
6
|
+
|
7
|
+
It is possible to add helpers methods to a world in three different ways:
|
8
|
+
|
9
|
+
1. Passing a module. In this case its methods will be added directly to the
|
10
|
+
world and be usable in the step definitions.
|
11
|
+
|
12
|
+
2. Passing a block, where the return value is the world object.
|
13
|
+
|
14
|
+
3. Passing a hash, where the keys are namespaces and the values are
|
15
|
+
modules. In this case, the methods of each module will be accessible using
|
16
|
+
the key as prefix.
|
17
|
+
|
18
|
+
Scenario: A world is extended using a module
|
19
|
+
Given a file named "features/support/helpers.rb" with:
|
20
|
+
"""
|
21
|
+
module Helpers
|
22
|
+
def helper_method
|
23
|
+
42
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
World(Helpers)
|
28
|
+
"""
|
29
|
+
And a file named "features/step_definitions/step.rb" with:
|
30
|
+
"""
|
31
|
+
Then /^the helper method is called$/ do
|
32
|
+
expect(helper_method).to eql(42)
|
33
|
+
end
|
34
|
+
"""
|
35
|
+
And a file named "features/f.feature" with:
|
36
|
+
"""
|
37
|
+
Feature: Calling a method
|
38
|
+
Scenario: I call a method without namespaces
|
39
|
+
Then the helper method is called
|
40
|
+
"""
|
41
|
+
When I run `cucumber features/f.feature`
|
42
|
+
Then it should pass
|
43
|
+
|
44
|
+
Scenario: A world is created using a block
|
45
|
+
Given a file named "features/support/helpers.rb" with:
|
46
|
+
"""
|
47
|
+
class Helper
|
48
|
+
def helper_method
|
49
|
+
42
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
World do
|
54
|
+
Helper.new
|
55
|
+
end
|
56
|
+
"""
|
57
|
+
And a file named "features/step_definitions/step.rb" with:
|
58
|
+
"""
|
59
|
+
Then /^the helper method is called$/ do
|
60
|
+
expect(helper_method).to eql(42)
|
61
|
+
end
|
62
|
+
"""
|
63
|
+
And a file named "features/f.feature" with:
|
64
|
+
"""
|
65
|
+
Feature: Calling a method
|
66
|
+
Scenario: I call a method from a namespace
|
67
|
+
Then the helper method is called
|
68
|
+
"""
|
69
|
+
When I run `cucumber features/f.feature`
|
70
|
+
Then it should pass
|
71
|
+
|
72
|
+
Scenario: A world is extended using a module with namespace
|
73
|
+
Given a file named "features/support/helpers.rb" with:
|
74
|
+
"""
|
75
|
+
module Helpers
|
76
|
+
def helper_method
|
77
|
+
42
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
World(my_namespace: Helpers)
|
82
|
+
"""
|
83
|
+
And a file named "features/step_definitions/step.rb" with:
|
84
|
+
"""
|
85
|
+
Then /^the helper method is called$/ do
|
86
|
+
expect(my_namespace.helper_method).to eql(42)
|
87
|
+
end
|
88
|
+
"""
|
89
|
+
And a file named "features/f.feature" with:
|
90
|
+
"""
|
91
|
+
Feature: Calling a method
|
92
|
+
Scenario: I call a method from a namespace
|
93
|
+
Then the helper method is called
|
94
|
+
"""
|
95
|
+
When I run `cucumber features/f.feature`
|
96
|
+
Then it should pass
|
97
|
+
|
98
|
+
Scenario: A world is extended using multiple modules with different namespaces
|
99
|
+
Given a file named "features/support/helpers.rb" with:
|
100
|
+
"""
|
101
|
+
module ModuleOne
|
102
|
+
def forty_one
|
103
|
+
41
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
module ModuleTwo
|
108
|
+
def forty_two
|
109
|
+
42
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
World(module_one: ModuleOne, module_two: ModuleTwo)
|
114
|
+
"""
|
115
|
+
And a file named "features/step_definitions/step.rb" with:
|
116
|
+
"""
|
117
|
+
Then /^the helper method is called$/ do
|
118
|
+
expect(module_one.forty_one).to eql(41)
|
119
|
+
expect(module_two.forty_two).to eql(42)
|
120
|
+
end
|
121
|
+
"""
|
122
|
+
And a file named "features/f.feature" with:
|
123
|
+
"""
|
124
|
+
Feature: Calling a method
|
125
|
+
Scenario: I call a method from two namespaces
|
126
|
+
Then the helper method is called
|
127
|
+
"""
|
128
|
+
When I run `cucumber features/f.feature`
|
129
|
+
Then it should pass
|
@@ -1,35 +1,55 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
Given /^a scenario "([^\"]*)" that fails once, then passes$/ do |full_name|
|
3
|
+
name = snake_case(full_name)
|
2
4
|
write_file "features/#{name}.feature",
|
3
5
|
<<-FEATURE
|
4
|
-
Feature: #{
|
5
|
-
Scenario: #{
|
6
|
+
Feature: #{full_name} feature
|
7
|
+
Scenario: #{full_name}
|
6
8
|
Given it fails once, then passes
|
7
9
|
FEATURE
|
8
10
|
|
9
11
|
write_file "features/step_defnitions/#{name}_steps.rb",
|
10
12
|
<<-STEPS
|
11
13
|
Given(/^it fails once, then passes$/) do
|
12
|
-
$#{name
|
13
|
-
$#{name.
|
14
|
-
expect($#{name.downcase}).to eql 2
|
14
|
+
$#{name} += 1
|
15
|
+
expect($#{name}).to be > 1
|
15
16
|
end
|
16
17
|
STEPS
|
18
|
+
|
19
|
+
write_file "features/support/#{name}_init.rb",
|
20
|
+
<<-INIT
|
21
|
+
$#{name} = 0
|
22
|
+
INIT
|
17
23
|
end
|
18
24
|
|
19
|
-
Given /^a scenario "([^\"]*)" that fails twice, then passes$/ do |
|
25
|
+
Given /^a scenario "([^\"]*)" that fails twice, then passes$/ do |full_name|
|
26
|
+
name = snake_case(full_name)
|
20
27
|
write_file "features/#{name}.feature",
|
21
28
|
<<-FEATURE
|
22
|
-
Feature: #{
|
23
|
-
Scenario: #{
|
29
|
+
Feature: #{full_name} feature
|
30
|
+
Scenario: #{full_name}
|
24
31
|
Given it fails twice, then passes
|
25
32
|
FEATURE
|
26
33
|
|
27
34
|
write_file "features/step_definitions/#{name}_steps.rb",
|
28
35
|
<<-STEPS
|
29
36
|
Given(/^it fails twice, then passes$/) do
|
30
|
-
$#{name
|
31
|
-
$#{name
|
32
|
-
expect($#{name
|
37
|
+
$#{name} ||= 0
|
38
|
+
$#{name} += 1
|
39
|
+
expect($#{name}).to be > 2
|
33
40
|
end
|
34
41
|
STEPS
|
42
|
+
|
43
|
+
write_file "features/support/#{name}_init.rb",
|
44
|
+
<<-INIT
|
45
|
+
$#{name} = 0
|
46
|
+
INIT
|
47
|
+
end
|
48
|
+
|
49
|
+
module SnakeCase
|
50
|
+
def snake_case(name)
|
51
|
+
name.downcase.gsub(/\W/, '_')
|
52
|
+
end
|
35
53
|
end
|
54
|
+
|
55
|
+
World(SnakeCase)
|
data/features/lib/support/env.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'aruba/cucumber'
|
2
3
|
require 'aruba/in_process'
|
3
4
|
require 'aruba/spawn_process'
|
@@ -17,5 +18,5 @@ Before do
|
|
17
18
|
# set_env('SIMPLECOV', 'true')
|
18
19
|
|
19
20
|
# Set a longer timeout for aruba, and a really long one if running on JRuby
|
20
|
-
@aruba_timeout_seconds = Cucumber::JRUBY ?
|
21
|
+
@aruba_timeout_seconds = Cucumber::JRUBY ? 60 : 15
|
21
22
|
end
|
data/gem_tasks/contributors.rake
CHANGED
data/gem_tasks/cov.rake
CHANGED
data/gem_tasks/cucumber.rake
CHANGED
data/gem_tasks/downloads.rb
CHANGED
data/gem_tasks/environment.rake
CHANGED
data/gem_tasks/examples.rake
CHANGED
data/gem_tasks/fix_cr_lf.rake
CHANGED
data/gem_tasks/flog.rake
CHANGED
data/gem_tasks/rspec.rake
CHANGED
data/gem_tasks/sass.rake
CHANGED
data/lib/autotest/cucumber.rb
CHANGED
data/lib/autotest/discover.rb
CHANGED
data/lib/cucumber.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'yaml'
|
2
3
|
require 'cucumber/encoding'
|
3
4
|
require 'cucumber/platform'
|
@@ -20,18 +21,5 @@ module Cucumber
|
|
20
21
|
def logger=(logger)
|
21
22
|
@log = logger
|
22
23
|
end
|
23
|
-
|
24
|
-
if Cucumber::RUBY_1_9
|
25
|
-
# Backported from Ruby 2.0 to 1.9
|
26
|
-
def Hash(other)
|
27
|
-
return {} if other.nil? || other == []
|
28
|
-
raise TypeError, "can't convert #{other.class} into Hash" unless other.respond_to?(:to_hash)
|
29
|
-
other.to_hash
|
30
|
-
end
|
31
|
-
else
|
32
|
-
def Hash(other)
|
33
|
-
Kernel::Hash(other)
|
34
|
-
end
|
35
|
-
end
|
36
24
|
end
|
37
25
|
end
|