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.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +22 -10
  3. data/CONTRIBUTING.md +13 -0
  4. data/Gemfile +11 -4
  5. data/History.md +19 -1
  6. data/README.md +1 -1
  7. data/cucumber.gemspec +2 -2
  8. data/cucumber.yml +2 -2
  9. data/features/docs/api/listen_for_events.feature +7 -6
  10. data/features/docs/cli/help.feature +8 -0
  11. data/features/docs/cli/retry_failing_tests.feature +51 -16
  12. data/features/docs/defining_steps/nested_steps_i18n.feature +2 -0
  13. data/features/docs/defining_steps/printing_messages.feature +0 -1
  14. data/features/docs/defining_steps/skip_scenario.feature +0 -34
  15. data/features/docs/extending_cucumber/custom_formatter.feature +2 -30
  16. data/features/docs/formatters/summary_formatter.feature +34 -0
  17. data/features/docs/gherkin/unicode_table.feature +1 -1
  18. data/features/docs/post_configuration_hook.feature +0 -16
  19. data/features/docs/writing_support_code/world.feature +129 -0
  20. data/features/lib/step_definitions/aruba_steps.rb +1 -0
  21. data/features/lib/step_definitions/cli_steps.rb +4 -0
  22. data/features/lib/step_definitions/cucumber_steps.rb +1 -0
  23. data/features/lib/step_definitions/iso-8859-1_steps.rb +1 -0
  24. data/features/lib/step_definitions/json_steps.rb +1 -0
  25. data/features/lib/step_definitions/junit_steps.rb +1 -0
  26. data/features/lib/step_definitions/language_steps.rb +1 -0
  27. data/features/lib/step_definitions/profile_steps.rb +1 -0
  28. data/features/lib/step_definitions/retry_steps.rb +32 -12
  29. data/features/lib/step_definitions/ruby_steps.rb +1 -0
  30. data/features/lib/step_definitions/wire_steps.rb +1 -0
  31. data/features/lib/support/env.rb +2 -1
  32. data/features/lib/support/fake_wire_server.rb +1 -0
  33. data/features/lib/support/feature_factory.rb +1 -0
  34. data/features/lib/support/normalise_output.rb +1 -0
  35. data/gem_tasks/contributors.rake +1 -0
  36. data/gem_tasks/cov.rake +1 -0
  37. data/gem_tasks/cucumber.rake +1 -0
  38. data/gem_tasks/downloads.rb +1 -0
  39. data/gem_tasks/environment.rake +1 -0
  40. data/gem_tasks/examples.rake +2 -1
  41. data/gem_tasks/fix_cr_lf.rake +2 -1
  42. data/gem_tasks/flog.rake +2 -1
  43. data/gem_tasks/rspec.rake +1 -0
  44. data/gem_tasks/sass.rake +2 -1
  45. data/lib/autotest/cucumber.rb +1 -0
  46. data/lib/autotest/cucumber_mixin.rb +1 -0
  47. data/lib/autotest/cucumber_rails.rb +1 -0
  48. data/lib/autotest/cucumber_rails_rspec.rb +1 -0
  49. data/lib/autotest/cucumber_rails_rspec2.rb +1 -0
  50. data/lib/autotest/cucumber_rspec.rb +1 -0
  51. data/lib/autotest/cucumber_rspec2.rb +1 -0
  52. data/lib/autotest/discover.rb +1 -0
  53. data/lib/cucumber.rb +1 -13
  54. data/lib/cucumber/cli/configuration.rb +3 -6
  55. data/lib/cucumber/cli/main.rb +2 -1
  56. data/lib/cucumber/cli/options.rb +239 -173
  57. data/lib/cucumber/cli/profile_loader.rb +1 -0
  58. data/lib/cucumber/cli/rerun_file.rb +1 -0
  59. data/lib/cucumber/configuration.rb +40 -19
  60. data/lib/cucumber/constantize.rb +1 -0
  61. data/lib/cucumber/core_ext/instance_exec.rb +1 -0
  62. data/lib/cucumber/core_ext/string.rb +1 -0
  63. data/lib/cucumber/deprecate.rb +1 -0
  64. data/lib/cucumber/encoding.rb +1 -0
  65. data/lib/cucumber/errors.rb +3 -1
  66. data/lib/cucumber/events.rb +13 -3
  67. data/lib/cucumber/events/step_definition_registered.rb +24 -0
  68. data/lib/cucumber/events/step_match.rb +4 -1
  69. data/lib/cucumber/events/test_run_finished.rb +12 -0
  70. data/lib/cucumber/file_specs.rb +1 -0
  71. data/lib/cucumber/filters.rb +2 -0
  72. data/lib/cucumber/filters/activate_steps.rb +2 -1
  73. data/lib/cucumber/filters/apply_after_hooks.rb +1 -0
  74. data/lib/cucumber/filters/apply_after_step_hooks.rb +1 -0
  75. data/lib/cucumber/filters/apply_around_hooks.rb +1 -0
  76. data/lib/cucumber/filters/apply_before_hooks.rb +1 -0
  77. data/lib/cucumber/filters/gated_receiver.rb +1 -0
  78. data/lib/cucumber/filters/prepare_world.rb +1 -0
  79. data/lib/cucumber/filters/quit.rb +1 -0
  80. data/lib/cucumber/filters/randomizer.rb +1 -0
  81. data/lib/cucumber/filters/retry.rb +3 -3
  82. data/lib/cucumber/filters/tag_limits.rb +1 -0
  83. data/lib/cucumber/filters/tag_limits/test_case_index.rb +1 -0
  84. data/lib/cucumber/filters/tag_limits/verifier.rb +1 -0
  85. data/lib/cucumber/formatter/ansicolor.rb +1 -0
  86. data/lib/cucumber/formatter/backtrace_filter.rb +3 -2
  87. data/lib/cucumber/formatter/console.rb +61 -52
  88. data/lib/cucumber/formatter/console_counts.rb +57 -0
  89. data/lib/cucumber/formatter/console_issues.rb +37 -0
  90. data/lib/cucumber/formatter/debug.rb +1 -0
  91. data/lib/cucumber/formatter/duration.rb +1 -0
  92. data/lib/cucumber/formatter/duration_extractor.rb +1 -0
  93. data/lib/cucumber/formatter/fail_fast.rb +4 -2
  94. data/lib/cucumber/formatter/fanout.rb +1 -0
  95. data/lib/cucumber/formatter/hook_query_visitor.rb +1 -0
  96. data/lib/cucumber/formatter/html.rb +6 -5
  97. data/lib/cucumber/formatter/ignore_missing_messages.rb +1 -0
  98. data/lib/cucumber/formatter/interceptor.rb +1 -0
  99. data/lib/cucumber/formatter/io.rb +1 -0
  100. data/lib/cucumber/formatter/json.rb +15 -13
  101. data/lib/cucumber/formatter/json_pretty.rb +1 -0
  102. data/lib/cucumber/formatter/junit.rb +13 -11
  103. data/lib/cucumber/formatter/legacy_api/adapter.rb +28 -32
  104. data/lib/cucumber/formatter/legacy_api/ast.rb +1 -0
  105. data/lib/cucumber/formatter/legacy_api/results.rb +1 -0
  106. data/lib/cucumber/formatter/legacy_api/runtime_facade.rb +1 -0
  107. data/lib/cucumber/formatter/pretty.rb +7 -1
  108. data/lib/cucumber/formatter/progress.rb +56 -13
  109. data/lib/cucumber/formatter/rerun.rb +15 -18
  110. data/lib/cucumber/formatter/stepdefs.rb +1 -0
  111. data/lib/cucumber/formatter/steps.rb +1 -0
  112. data/lib/cucumber/formatter/summary.rb +43 -20
  113. data/lib/cucumber/formatter/unicode.rb +1 -0
  114. data/lib/cucumber/formatter/usage.rb +26 -21
  115. data/lib/cucumber/gherkin/data_table_parser.rb +1 -0
  116. data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +1 -0
  117. data/lib/cucumber/gherkin/formatter/escaping.rb +1 -0
  118. data/lib/cucumber/gherkin/i18n.rb +1 -0
  119. data/lib/cucumber/gherkin/steps_parser.rb +1 -0
  120. data/lib/cucumber/hooks.rb +1 -0
  121. data/lib/cucumber/load_path.rb +1 -0
  122. data/lib/cucumber/multiline_argument.rb +1 -2
  123. data/lib/cucumber/multiline_argument/data_table.rb +3 -1
  124. data/lib/cucumber/multiline_argument/doc_string.rb +1 -0
  125. data/lib/cucumber/platform.rb +1 -0
  126. data/lib/cucumber/project_initializer.rb +2 -1
  127. data/lib/cucumber/rake/task.rb +1 -0
  128. data/lib/cucumber/rb_support/rb_dsl.rb +11 -9
  129. data/lib/cucumber/rb_support/rb_hook.rb +1 -0
  130. data/lib/cucumber/rb_support/rb_language.rb +19 -8
  131. data/lib/cucumber/rb_support/rb_step_definition.rb +1 -0
  132. data/lib/cucumber/rb_support/rb_transform.rb +1 -0
  133. data/lib/cucumber/rb_support/rb_world.rb +42 -20
  134. data/lib/cucumber/rb_support/snippet.rb +2 -1
  135. data/lib/cucumber/rspec/disable_option_parser.rb +1 -0
  136. data/lib/cucumber/rspec/doubles.rb +1 -0
  137. data/lib/cucumber/running_test_case.rb +1 -25
  138. data/lib/cucumber/runtime.rb +15 -10
  139. data/lib/cucumber/runtime/after_hooks.rb +1 -0
  140. data/lib/cucumber/runtime/before_hooks.rb +1 -0
  141. data/lib/cucumber/runtime/for_programming_languages.rb +1 -0
  142. data/lib/cucumber/runtime/step_hooks.rb +1 -0
  143. data/lib/cucumber/runtime/support_code.rb +1 -0
  144. data/lib/cucumber/runtime/user_interface.rb +1 -0
  145. data/lib/cucumber/step_argument.rb +1 -0
  146. data/lib/cucumber/step_definition_light.rb +1 -0
  147. data/lib/cucumber/step_definitions.rb +1 -0
  148. data/lib/cucumber/step_match.rb +1 -0
  149. data/lib/cucumber/step_match_search.rb +1 -0
  150. data/lib/cucumber/term/ansicolor.rb +1 -0
  151. data/lib/cucumber/unit.rb +1 -0
  152. data/lib/cucumber/version +1 -1
  153. data/lib/simplecov_setup.rb +1 -0
  154. data/spec/cucumber/cli/configuration_spec.rb +1 -0
  155. data/spec/cucumber/cli/main_spec.rb +1 -0
  156. data/spec/cucumber/cli/options_spec.rb +1 -0
  157. data/spec/cucumber/cli/profile_loader_spec.rb +1 -0
  158. data/spec/cucumber/cli/rerun_spec.rb +1 -0
  159. data/spec/cucumber/configuration_spec.rb +1 -0
  160. data/spec/cucumber/constantize_spec.rb +1 -0
  161. data/spec/cucumber/core_ext/instance_exec_spec.rb +1 -0
  162. data/spec/cucumber/file_specs_spec.rb +1 -0
  163. data/spec/cucumber/filters/activate_steps_spec.rb +9 -6
  164. data/spec/cucumber/filters/gated_receiver_spec.rb +1 -0
  165. data/spec/cucumber/filters/retry_spec.rb +27 -21
  166. data/spec/cucumber/filters/tag_limits/test_case_index_spec.rb +1 -0
  167. data/spec/cucumber/filters/tag_limits/verifier_spec.rb +1 -0
  168. data/spec/cucumber/filters/tag_limits_spec.rb +1 -0
  169. data/spec/cucumber/formatter/ansicolor_spec.rb +1 -0
  170. data/spec/cucumber/formatter/console_counts_spec.rb +14 -0
  171. data/spec/cucumber/formatter/debug_spec.rb +1 -0
  172. data/spec/cucumber/formatter/duration_spec.rb +1 -0
  173. data/spec/cucumber/formatter/fail_fast_spec.rb +5 -5
  174. data/spec/cucumber/formatter/html_spec.rb +6 -1
  175. data/spec/cucumber/formatter/interceptor_spec.rb +1 -0
  176. data/spec/cucumber/formatter/json_spec.rb +29 -28
  177. data/spec/cucumber/formatter/junit_spec.rb +1 -0
  178. data/spec/cucumber/formatter/legacy_api/adapter_spec.rb +8 -3
  179. data/spec/cucumber/formatter/pretty_spec.rb +1 -0
  180. data/spec/cucumber/formatter/progress_spec.rb +2 -1
  181. data/spec/cucumber/formatter/rerun_spec.rb +70 -64
  182. data/spec/cucumber/formatter/spec_helper.rb +8 -7
  183. data/spec/cucumber/hooks_spec.rb +1 -0
  184. data/spec/cucumber/multiline_argument/data_table_spec.rb +1 -0
  185. data/spec/cucumber/project_initializer_spec.rb +2 -1
  186. data/spec/cucumber/rake/forked_spec.rb +1 -0
  187. data/spec/cucumber/rake/task_spec.rb +1 -0
  188. data/spec/cucumber/rb_support/rb_language_spec.rb +81 -3
  189. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +1 -0
  190. data/spec/cucumber/rb_support/rb_transform_spec.rb +1 -0
  191. data/spec/cucumber/rb_support/rb_world_spec.rb +2 -1
  192. data/spec/cucumber/rb_support/snippet_spec.rb +1 -0
  193. data/spec/cucumber/running_test_case_spec.rb +1 -0
  194. data/spec/cucumber/runtime/for_programming_languages_spec.rb +1 -0
  195. data/spec/cucumber/runtime/support_code_spec.rb +1 -0
  196. data/spec/cucumber/runtime_spec.rb +1 -0
  197. data/spec/cucumber/step_argument_spec.rb +1 -0
  198. data/spec/cucumber/step_match_search_spec.rb +1 -0
  199. data/spec/cucumber/step_match_spec.rb +1 -0
  200. data/spec/cucumber/world/pending_spec.rb +1 -0
  201. data/spec/spec_helper.rb +1 -0
  202. data/spec/support/standard_step_actions.rb +1 -0
  203. metadata +24 -23
  204. data/lib/cucumber/ast.rb +0 -13
  205. data/lib/cucumber/events/after_test_case.rb +0 -25
  206. data/lib/cucumber/events/after_test_step.rb +0 -30
  207. data/lib/cucumber/events/before_test_case.rb +0 -18
  208. data/lib/cucumber/events/before_test_step.rb +0 -23
  209. data/lib/cucumber/events/bus.rb +0 -86
  210. data/lib/cucumber/events/finished_testing.rb +0 -9
  211. data/lib/cucumber/formatter/event_bus_report.rb +0 -38
  212. data/spec/cucumber/events/bus_spec.rb +0 -94
  213. data/spec/cucumber/formatter/event_bus_report_spec.rb +0 -88
  214. data/spec/cucumber_spec.rb +0 -39
@@ -1,4 +1,4 @@
1
- @spawn
1
+ @spawn @wip-jruby
2
2
  Feature: Unicode in tables
3
3
 
4
4
  You are free to use unicode in your tables: we've taken care to
@@ -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,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  Given('a Gemfile with:') do |content|
2
3
  path = File.expand_path(current_dir + "/Gemfile")
3
4
  write_file path, content
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+ Then(/^I should see the CLI help$/) do
3
+ expect(all_output).to include("Usage:")
4
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  Given /^a directory without standard Cucumber project directory structure$/ do
2
3
  in_current_dir do
3
4
  FileUtils.rm_rf 'features' if File.directory?('features')
@@ -1,4 +1,5 @@
1
1
  # encoding: iso-8859-1
2
+ # frozen_string_literal: true
2
3
  # Ideally we would use Norwegian keywords here, but that won't work unless this file is UTF-8 encoded.
3
4
  # Alternatively it would be possible to use Norwegian keywords and encode the file as UTF-8.
4
5
  #
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  Then /^it should (pass|fail) with JSON:$/ do |pass_fail, json|
2
3
  actual = normalise_json(MultiJson.load(all_stdout))
3
4
  expected = MultiJson.load(json)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  Then(/^the junit output file "(.*?)" should contain:$/) do |actual_file, text|
2
3
  actual = IO.read(current_dir + '/' + actual_file)
3
4
  actual = replace_junit_time(actual)
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  Then(/^cucumber lists all the supported languages$/) do
4
5
  sample_languages = ["Arabic", "български", "Pirate", "English", "日本語"]
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  Given /^the following profiles? (?:are|is) defined:$/ do |profiles|
2
3
  write_file 'cucumber.yml', profiles
3
4
  end
@@ -1,35 +1,55 @@
1
- Given /^a scenario "([^\"]*)" that fails once, then passes$/ do |name|
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: #{name}
5
- Scenario: #{name}
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.downcase} ||= 0
13
- $#{name.downcase} += 1
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 |name|
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: #{name}
23
- Scenario: #{name}
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.downcase} ||= 0
31
- $#{name.downcase} += 1
32
- expect($#{name.downcase}).to eql 3
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)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  When(/^I run the following Ruby code:$/) do |code|
2
3
  run_simple %{ruby -e "#{code}"}
3
4
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  Given /^there is a wire server (running |)on port (\d+) which understands the following protocol:$/ do |running, port, table|
2
3
  protocol = table.hashes.map do |table_hash|
3
4
  table_hash['response'] = table_hash['response'].gsub(/\n/, '\n')
@@ -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 ? 35 : 15
21
+ @aruba_timeout_seconds = Cucumber::JRUBY ? 60 : 15
21
22
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'multi_json'
2
3
  require 'socket'
3
4
 
@@ -1,4 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
+ # frozen_string_literal: true
2
3
  module FeatureFactory
3
4
  def create_feature(name = generate_feature_name)
4
5
  gherkin = <<-GHERKIN
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # override aruba to filter out some stuff
2
3
  module NormaliseArubaOutput
3
4
  def all_stdout
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  desc 'List contributors'
3
4
  task :contributors do
4
5
  contributors = `git log --pretty=short --no-merges | git shortlog -ne | egrep -ve '^ +' | egrep -ve '^$'`.split("\n")
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  desc 'Run all tests and collect code coverage'
2
3
  task :cov do
3
4
  ENV['SIMPLECOV'] = 'features'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'cucumber/rake/task'
2
3
  require 'cucumber/platform'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'httparty'
2
3
  require 'multi_json'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  task :ruby_env do
2
3
  RUBY_APP = if RUBY_PLATFORM =~ /java/
3
4
  "jruby"
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  desc 'Run all exmples'
2
3
  task :examples do
3
4
  Dir['examples/*'].each do |example_dir|
@@ -8,4 +9,4 @@ task :examples do
8
9
  sh "rake cucumber"
9
10
  end
10
11
  end
11
- end
12
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  desc 'Make all files use UNIX (\n) line endings'
2
3
  task :fix_cr_lf do
3
4
  files = FileList['**/*']
@@ -7,4 +8,4 @@ task :fix_cr_lf do
7
8
  s.gsub!(/\r?\n/, "\n")
8
9
  File.open(f, "w") { |io| io.write(s) }
9
10
  end
10
- end
11
+ end
@@ -1,4 +1,5 @@
1
+ # frozen_string_literal: true
1
2
  desc "Run flog over significant files"
2
3
  task :flog do
3
4
  sh "find lib/cucumber -name \\*.rb | grep -v parser\/feature\\.rb | xargs flog"
4
- end
5
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rspec/core/rake_task'
2
3
 
3
4
  desc "Run RSpec"
@@ -1,4 +1,5 @@
1
+ # frozen_string_literal: true
1
2
  desc 'Generate the css for the html formatter from sass'
2
3
  task :sass do
3
4
  sh 'sass -t expanded lib/cucumber/formatter/cucumber.sass > lib/cucumber/formatter/cucumber.css'
4
- end
5
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'autotest'
2
3
  require 'autotest/cucumber_mixin'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'autotest'
2
3
  require 'tempfile'
3
4
  require 'cucumber'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'autotest/rails'
2
3
  require 'autotest/cucumber_mixin'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'autotest/cucumber_mixin'
2
3
  require 'autotest/rails_rspec'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'autotest/cucumber_mixin'
2
3
  require 'autotest/rails_rspec2'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'autotest/cucumber_mixin'
2
3
  require 'autotest/rspec'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'autotest/cucumber_mixin'
2
3
  require 'autotest/rspec2'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  Autotest.add_discovery do
2
3
  if File.directory?('features')
3
4
  if ENV['AUTOFEATURE'] =~ /true/i
@@ -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