cucumber 3.1.0 → 3.1.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/CHANGELOG.md +38 -2
- data/CONTRIBUTING.md +1 -0
- data/README.md +6 -7
- 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 -0
- data/lib/cucumber/cli/configuration.rb +1 -0
- data/lib/cucumber/cli/main.rb +2 -2
- data/lib/cucumber/cli/options.rb +42 -40
- data/lib/cucumber/cli/profile_loader.rb +5 -7
- data/lib/cucumber/cli/rerun_file.rb +1 -0
- data/lib/cucumber/configuration.rb +1 -0
- data/lib/cucumber/constantize.rb +6 -5
- data/lib/cucumber/core_ext/string.rb +1 -0
- data/lib/cucumber/deprecate.rb +1 -1
- data/lib/cucumber/encoding.rb +2 -1
- data/lib/cucumber/errors.rb +1 -0
- data/lib/cucumber/events.rb +1 -1
- data/lib/cucumber/events/gherkin_source_read.rb +1 -4
- data/lib/cucumber/events/step_activated.rb +4 -5
- data/lib/cucumber/events/step_definition_registered.rb +4 -8
- data/lib/cucumber/events/test_case_finished.rb +0 -4
- data/lib/cucumber/events/test_case_started.rb +0 -4
- data/lib/cucumber/events/test_run_finished.rb +2 -3
- data/lib/cucumber/events/test_run_started.rb +2 -4
- data/lib/cucumber/events/test_step_finished.rb +0 -4
- data/lib/cucumber/events/test_step_started.rb +1 -5
- data/lib/cucumber/file_specs.rb +2 -1
- data/lib/cucumber/filters.rb +1 -0
- data/lib/cucumber/filters/activate_steps.rb +1 -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/broadcast_test_run_started_event.rb +2 -1
- data/lib/cucumber/filters/gated_receiver.rb +1 -2
- data/lib/cucumber/filters/prepare_world.rb +2 -5
- data/lib/cucumber/filters/quit.rb +2 -3
- data/lib/cucumber/filters/randomizer.rb +6 -7
- data/lib/cucumber/filters/retry.rb +2 -2
- data/lib/cucumber/filters/tag_limits.rb +2 -2
- data/lib/cucumber/filters/tag_limits/test_case_index.rb +1 -2
- data/lib/cucumber/filters/tag_limits/verifier.rb +1 -2
- data/lib/cucumber/formatter/ansicolor.rb +13 -12
- data/lib/cucumber/formatter/backtrace_filter.rb +1 -2
- data/lib/cucumber/formatter/console.rb +10 -11
- data/lib/cucumber/formatter/console_counts.rb +4 -4
- data/lib/cucumber/formatter/console_issues.rb +3 -3
- data/lib/cucumber/formatter/duration.rb +1 -0
- data/lib/cucumber/formatter/duration_extractor.rb +1 -1
- data/lib/cucumber/formatter/fail_fast.rb +9 -6
- data/lib/cucumber/formatter/fanout.rb +1 -3
- data/lib/cucumber/formatter/hook_query_visitor.rb +1 -0
- data/lib/cucumber/formatter/html.rb +27 -31
- data/lib/cucumber/formatter/html_builder.rb +2 -1
- data/lib/cucumber/formatter/ignore_missing_messages.rb +1 -2
- data/lib/cucumber/formatter/interceptor.rb +18 -5
- data/lib/cucumber/formatter/io.rb +1 -0
- data/lib/cucumber/formatter/json.rb +2 -1
- data/lib/cucumber/formatter/json_pretty.rb +1 -0
- data/lib/cucumber/formatter/junit.rb +16 -15
- data/lib/cucumber/formatter/pretty.rb +3 -2
- data/lib/cucumber/formatter/progress.rb +3 -2
- data/lib/cucumber/formatter/rerun.rb +1 -0
- data/lib/cucumber/formatter/stepdefs.rb +1 -0
- data/lib/cucumber/formatter/steps.rb +2 -2
- data/lib/cucumber/formatter/summary.rb +1 -1
- data/lib/cucumber/formatter/unicode.rb +2 -2
- data/lib/cucumber/formatter/usage.rb +21 -18
- data/lib/cucumber/gherkin/data_table_parser.rb +1 -0
- data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +86 -85
- data/lib/cucumber/gherkin/formatter/escaping.rb +13 -12
- data/lib/cucumber/gherkin/i18n.rb +1 -0
- data/lib/cucumber/gherkin/steps_parser.rb +1 -0
- data/lib/cucumber/glue/dsl.rb +1 -0
- data/lib/cucumber/glue/hook.rb +1 -0
- data/lib/cucumber/glue/invoke_in_world.rb +3 -3
- data/lib/cucumber/glue/proto_world.rb +8 -9
- data/lib/cucumber/glue/registry_and_more.rb +13 -12
- data/lib/cucumber/glue/snippet.rb +1 -5
- data/lib/cucumber/glue/step_definition.rb +9 -9
- data/lib/cucumber/glue/world_factory.rb +0 -2
- data/lib/cucumber/hooks.rb +1 -3
- data/lib/cucumber/load_path.rb +1 -0
- data/lib/cucumber/multiline_argument.rb +2 -2
- data/lib/cucumber/multiline_argument/data_table.rb +10 -10
- data/lib/cucumber/multiline_argument/data_table/diff_matrices.rb +4 -7
- data/lib/cucumber/multiline_argument/doc_string.rb +1 -0
- data/lib/cucumber/platform.rb +2 -1
- data/lib/cucumber/project_initializer.rb +1 -1
- data/lib/cucumber/rake/task.rb +7 -4
- 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 +2 -1
- data/lib/cucumber/runtime.rb +5 -5
- 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 +8 -7
- data/lib/cucumber/runtime/step_hooks.rb +2 -0
- data/lib/cucumber/runtime/support_code.rb +3 -7
- data/lib/cucumber/runtime/user_interface.rb +2 -3
- data/lib/cucumber/step_argument.rb +1 -0
- data/lib/cucumber/step_definition_light.rb +2 -1
- data/lib/cucumber/step_definitions.rb +1 -0
- data/lib/cucumber/step_match.rb +5 -7
- data/lib/cucumber/step_match_search.rb +1 -2
- data/lib/cucumber/term/ansicolor.rb +30 -30
- data/lib/cucumber/unit.rb +1 -0
- data/lib/cucumber/version +1 -1
- data/lib/simplecov_setup.rb +1 -0
- metadata +61 -117
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fc886b206588160432745dd94cb419b71dd3952
|
4
|
+
data.tar.gz: ade0e5e45e889f9717baa2d2dd8fad60932bf667
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9f244e9f05394029284305f8aa39a0472507c498ca764f9c3141bc96d9521e6d37ad6ec5e898b893dc726bcd57c9537acb40e479d42660f8f3bf946adea2b92
|
7
|
+
data.tar.gz: d68d77df58b2f659b5689334eb2a8833ba7bf2beb977a0da20dcb25a28e3c69e8b20bc76ecf25117e6a71914b98f4f094db85f8860f8b2caee8fbdcff3c24b7a
|
data/CHANGELOG.md
CHANGED
@@ -10,7 +10,7 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
|
|
10
10
|
|
11
11
|
----
|
12
12
|
|
13
|
-
## [In Git](https://github.com/cucumber/cucumber-ruby/compare/v3.1.
|
13
|
+
## [In Git](https://github.com/cucumber/cucumber-ruby/compare/v3.1.1...master) (Not released)
|
14
14
|
|
15
15
|
### Added
|
16
16
|
|
@@ -32,7 +32,43 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
|
|
32
32
|
|
33
33
|
* N/A
|
34
34
|
|
35
|
-
|
35
|
+
### Improved
|
36
|
+
|
37
|
+
* N/A
|
38
|
+
|
39
|
+
## [3.1.1](https://github.com/cucumber/cucumber-ruby/compare/v3.1.0...v3.1.1) (2018-06-03)
|
40
|
+
|
41
|
+
### Added
|
42
|
+
|
43
|
+
* N/A
|
44
|
+
|
45
|
+
### Changed
|
46
|
+
|
47
|
+
* Add Rubocop to default Rake task ([#1256](https://github.com/cucumber/cucumber-ruby/pull/1256) [@jaysonesmith](https://github.com/jaysonesmith))
|
48
|
+
* Upgraded `cucumber-expressions` dependency to ~> 6.0.0 ([#1299](https://github.com/cucumber/cucumber-ruby/pull/1299) [@aslakhellesoy](https://github.com/aslakhellesoy))
|
49
|
+
* Upgraded to `gherkin` 5.1.0 ([#1299](https://github.com/cucumber/cucumber-ruby/pull/1299) [@aslakhellesoy](https://github.com/aslakhellesoy))
|
50
|
+
|
51
|
+
### Deprecated
|
52
|
+
|
53
|
+
* N/A
|
54
|
+
|
55
|
+
### Removed
|
56
|
+
|
57
|
+
* N/A
|
58
|
+
|
59
|
+
### Fixed
|
60
|
+
|
61
|
+
* Make `--fail-fast` play nice with `--retry` ([#1283](https://github.com/cucumber/cucumber-ruby/pull/1283) [@yrral86](https://github.com/yrral86))
|
62
|
+
* Fix incompatible encodings error in JUnit formatter ([#1244](https://github.com/cucumber/cucumber-ruby/pull/1244) [@NickAb](https://github.com/NickAb)) (except on JRuby, see [#1259](https://github.com/cucumber/cucumber-ruby/pull/1259))
|
63
|
+
* Fix the handling of failed hooks in the JUnit Formatter ([@brasmusson](https://github.com/brasmusson))
|
64
|
+
* Fixed lengthy stacktrace when running `cucumber -f stepdefs` when steps aren't defined. ([#1286](https://github.com/cucumber/cucumber-ruby/pull/1286) [@xtrasimplicity](https://github.com/xtrasimplicity))
|
65
|
+
* Fixed an error with HTML snippet generation when `frozen_string_literal` is enabled and the `Syntax` gem is not installed. ([#1287](https://github.com/cucumber/cucumber-ruby/pull/1287) [@xtrasimplicity](https://github.com/xtrasimplicity))
|
66
|
+
|
67
|
+
### Improved
|
68
|
+
|
69
|
+
* N/A
|
70
|
+
|
71
|
+
## [3.1.0](https://github.com/cucumber/cucumber-ruby/compare/v3.0.2...v3.1.0) (2017-11-28)
|
36
72
|
|
37
73
|
### Added
|
38
74
|
|
data/CONTRIBUTING.md
CHANGED
@@ -79,6 +79,7 @@ Current release managers:
|
|
79
79
|
* [Oleg Sukhodolsky](https://rubygems.org/profiles/os97673)
|
80
80
|
* [Steve Tooke](https://rubygems.org/profiles/tooky)
|
81
81
|
* [Björn Rasmusson](https://rubygems.org/profiles/brasmusson)
|
82
|
+
* [Andrew Walter](https://rubygems.org/profiles/xtrasimplicity)
|
82
83
|
|
83
84
|
To grant release karma, issue the following commands:
|
84
85
|
|
data/README.md
CHANGED
@@ -16,20 +16,19 @@ your team.
|
|
16
16
|
|
17
17
|
Where to get more info:
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
* The main website: https://cucumber.io/
|
20
|
+
* Documentation: https://docs.cucumber.io
|
21
|
+
* Ruby API Documentation: http://www.rubydoc.info/github/cucumber/cucumber-ruby/
|
22
|
+
* Support forum: https://groups.google.com/group/cukes
|
23
|
+
* Chat: ([Slack](https://cucumber.io/support#slack) and [Gitter](https://cucumber.io/support#gitter))
|
24
24
|
|
25
25
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for info on contributing to Cucumber.
|
26
26
|
|
27
27
|
## Supported platforms
|
28
|
-
|
28
|
+
* Ruby 2.5
|
29
29
|
* Ruby 2.4
|
30
30
|
* Ruby 2.3
|
31
31
|
* Ruby 2.2
|
32
|
-
* Ruby 2.1
|
33
32
|
* JRuby 9.1
|
34
33
|
|
35
34
|
## Code of Conduct
|
data/lib/autotest/cucumber.rb
CHANGED
data/lib/autotest/discover.rb
CHANGED
data/lib/cucumber.rb
CHANGED
data/lib/cucumber/cli/main.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'optparse'
|
3
4
|
require 'cucumber'
|
4
5
|
require 'logger'
|
@@ -13,7 +14,7 @@ module Cucumber
|
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
16
|
-
def initialize(args, _=nil, out=STDOUT, err=STDERR, kernel=Kernel)
|
17
|
+
def initialize(args, _ = nil, out = STDOUT, err = STDERR, kernel = Kernel)
|
17
18
|
@args = args
|
18
19
|
@out = out
|
19
20
|
@err = err
|
@@ -70,7 +71,6 @@ module Cucumber
|
|
70
71
|
|
71
72
|
private
|
72
73
|
|
73
|
-
|
74
74
|
def exit_ok
|
75
75
|
@kernel.exit 0
|
76
76
|
end
|
data/lib/cucumber/cli/options.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'cucumber/cli/profile_loader'
|
3
4
|
require 'cucumber/formatter/ansicolor'
|
4
5
|
require 'cucumber/glue/registry_and_more'
|
@@ -7,9 +8,9 @@ require 'cucumber/core/test/result'
|
|
7
8
|
|
8
9
|
module Cucumber
|
9
10
|
module Cli
|
10
|
-
|
11
11
|
class Options
|
12
12
|
INDENT = ' ' * 53
|
13
|
+
# rubocop:disable Layout/MultilineOperationIndentation
|
13
14
|
BUILTIN_FORMATS = {
|
14
15
|
'html' => ['Cucumber::Formatter::Html', 'Generates a nice looking HTML report.'],
|
15
16
|
'pretty' => ['Cucumber::Formatter::Pretty', 'Prints the feature as is - in colours.'],
|
@@ -27,19 +28,20 @@ module Cucumber
|
|
27
28
|
'json_pretty' => ['Cucumber::Formatter::JsonPretty', 'Prints the feature as prettified JSON'],
|
28
29
|
'summary' => ['Cucumber::Formatter::Summary', 'Summary output of feature and scenarios']
|
29
30
|
}
|
31
|
+
# rubocop:enable Layout/MultilineOperationIndentation
|
30
32
|
max = BUILTIN_FORMATS.keys.map(&:length).max
|
31
33
|
FORMAT_HELP_MSG = [
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
34
|
+
'Use --format rerun --out rerun.txt to write out failing',
|
35
|
+
'features. You can rerun them with cucumber @rerun.txt.',
|
36
|
+
'FORMAT can also be the fully qualified class name of',
|
37
|
+
"your own custom formatter. If the class isn't loaded,",
|
38
|
+
'Cucumber will attempt to require a file with a relative',
|
39
|
+
'file name that is the underscore name of the class name.',
|
40
|
+
'Example: --format Foo::BarZap -> Cucumber will look for',
|
41
|
+
'foo/bar_zap.rb. You can place the file with this relative',
|
42
|
+
'path underneath your features/support directory or anywhere',
|
43
|
+
"on Ruby's LOAD_PATH, for example in a Ruby gem."
|
44
|
+
]
|
43
45
|
|
44
46
|
FORMAT_HELP = (BUILTIN_FORMATS.keys.sort.map do |key|
|
45
47
|
" #{key}#{' ' * (max - key.length)} : #{BUILTIN_FORMATS[key][1]}"
|
@@ -51,11 +53,11 @@ module Cucumber
|
|
51
53
|
FAIL_FAST_FLAG = '--fail-fast'
|
52
54
|
RETRY_FLAG = '--retry'
|
53
55
|
OPTIONS_WITH_ARGS = [
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
'-r', '--require', '--i18n-keywords', '-f', '--format', '-o',
|
57
|
+
'--out', '-t', '--tags', '-n', '--name', '-e', '--exclude',
|
58
|
+
PROFILE_SHORT_FLAG, PROFILE_LONG_FLAG, RETRY_FLAG, '-l',
|
59
|
+
'--lines', '--port', '-I', '--snippet-type'
|
60
|
+
]
|
59
61
|
ORDER_TYPES = %w{defined random}
|
60
62
|
TAG_LIMIT_MATCHER = /(?<tag_name>\@\w+):(?<limit>\d+)/x
|
61
63
|
|
@@ -95,25 +97,25 @@ module Cucumber
|
|
95
97
|
opts.banner = banner
|
96
98
|
opts.on('-r LIBRARY|DIR', '--require LIBRARY|DIR', *require_files_msg) {|lib| require_files(lib) }
|
97
99
|
|
98
|
-
if
|
100
|
+
if Cucumber::JRUBY
|
99
101
|
opts.on('-j DIR', '--jars DIR', 'Load all the jars under DIR') {|jars| load_jars(jars) }
|
100
102
|
end
|
101
103
|
|
102
104
|
opts.on("#{RETRY_FLAG} ATTEMPTS", *retry_msg) {|v| set_option :retry, v.to_i }
|
103
105
|
opts.on('--i18n-languages', *i18n_languages_msg) { list_languages_and_exit }
|
104
|
-
opts.on('--i18n-keywords LANG', *i18n_keywords_msg) {|lang|
|
106
|
+
opts.on('--i18n-keywords LANG', *i18n_keywords_msg) {|lang| language lang }
|
105
107
|
opts.on(FAIL_FAST_FLAG, 'Exit immediately following the first failing scenario') { set_option :fail_fast }
|
106
108
|
opts.on('-f FORMAT', '--format FORMAT', *format_msg, *FORMAT_HELP) do |v|
|
107
109
|
add_option :formats, [*parse_formats(v), @out_stream]
|
108
110
|
end
|
109
111
|
opts.on('--init', *init_msg) {|v| initialize_project }
|
110
|
-
opts.on('-o', '--out [FILE|DIR]', *out_msg) {|v|
|
112
|
+
opts.on('-o', '--out [FILE|DIR]', *out_msg) {|v| out_stream v }
|
111
113
|
opts.on('-t TAG_EXPRESSION', '--tags TAG_EXPRESSION', *tags_msg) {|v| add_tag v }
|
112
114
|
opts.on('-n NAME', '--name NAME', *name_msg) {|v| add_option :name_regexps, /#{v}/ }
|
113
115
|
opts.on('-e', '--exclude PATTERN', *exclude_msg) {|v| add_option :excludes, Regexp.new(v) }
|
114
116
|
opts.on(PROFILE_SHORT_FLAG, "#{PROFILE_LONG_FLAG} PROFILE", *profile_short_flag_msg) {|v| add_profile v }
|
115
117
|
opts.on(NO_PROFILE_SHORT_FLAG, NO_PROFILE_LONG_FLAG, *no_profile_short_flag_msg) {|v| disable_profile_loading }
|
116
|
-
opts.on('-c', '--[no-]color', *color_msg) {|v|
|
118
|
+
opts.on('-c', '--[no-]color', *color_msg) {|v| color v }
|
117
119
|
opts.on('-d', '--dry-run', *dry_run_msg) { set_dry_run_and_duration }
|
118
120
|
opts.on('-m', '--no-multiline', "Don't print multiline strings and tables under steps.") { set_option :no_multiline }
|
119
121
|
opts.on('-s', '--no-source', "Don't print the file and line of the step definition with the steps.") { set_option :source, false }
|
@@ -133,7 +135,7 @@ module Cucumber
|
|
133
135
|
opts.on('-x', '--expand', 'Expand Scenario Outline Tables in output.') { set_option :expand }
|
134
136
|
|
135
137
|
opts.on('--order TYPE[:SEED]', 'Run examples in the specified order. Available types:',
|
136
|
-
|
138
|
+
*<<-TEXT.split("\n")) do |order|
|
137
139
|
[defined] Run scenarios in the order they were defined (default).
|
138
140
|
[random] Shuffle scenarios before running.
|
139
141
|
Specify SEED to reproduce the shuffling from a previous run.
|
@@ -152,7 +154,7 @@ TEXT
|
|
152
154
|
@args.map! { |a| "#{a}:#{@options[:lines]}" } if @options[:lines]
|
153
155
|
|
154
156
|
extract_environment_variables
|
155
|
-
@options[:paths] = @args.dup #whatver is left over
|
157
|
+
@options[:paths] = @args.dup # whatver is left over
|
156
158
|
|
157
159
|
check_formatter_stream_conflicts()
|
158
160
|
|
@@ -201,11 +203,11 @@ TEXT
|
|
201
203
|
end
|
202
204
|
|
203
205
|
def exclude_msg
|
204
|
-
[
|
206
|
+
["Don't run feature files or require ruby files matching PATTERN"]
|
205
207
|
end
|
206
208
|
|
207
209
|
def format_msg
|
208
|
-
[
|
210
|
+
['How to format features (Default: pretty). Available formats:']
|
209
211
|
end
|
210
212
|
|
211
213
|
def i18n_languages_msg
|
@@ -229,7 +231,7 @@ TEXT
|
|
229
231
|
end
|
230
232
|
|
231
233
|
def lines_msg
|
232
|
-
[
|
234
|
+
['Run given line numbers. Equivalent to FILE:LINE syntax']
|
233
235
|
end
|
234
236
|
|
235
237
|
def no_profile_short_flag_msg
|
@@ -249,7 +251,7 @@ TEXT
|
|
249
251
|
end
|
250
252
|
|
251
253
|
def retry_msg
|
252
|
-
[
|
254
|
+
['Specify the number of times to retry failing tests (default: 0)']
|
253
255
|
end
|
254
256
|
|
255
257
|
def name_msg
|
@@ -273,7 +275,7 @@ TEXT
|
|
273
275
|
[formatter, options_hash]
|
274
276
|
end
|
275
277
|
|
276
|
-
def
|
278
|
+
def out_stream(v)
|
277
279
|
@options[:formats] << ['pretty', {}, nil] if @options[:formats].empty?
|
278
280
|
@options[:formats][-1][2] = v
|
279
281
|
end
|
@@ -332,12 +334,12 @@ TEXT
|
|
332
334
|
|
333
335
|
def banner
|
334
336
|
[
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
337
|
+
'Usage: cucumber [options] [ [FILE|DIR|URL][:LINE[:LINE]*] ]+', '',
|
338
|
+
'Examples:',
|
339
|
+
'cucumber examples/i18n/en/features',
|
340
|
+
'cucumber @rerun.txt (See --format rerun)',
|
341
|
+
'cucumber examples/i18n/it/features/somma.feature:6:98:113',
|
342
|
+
'cucumber -s -i http://rubyurl.com/eeCl', '', ''
|
341
343
|
].join("\n")
|
342
344
|
end
|
343
345
|
|
@@ -352,7 +354,7 @@ TEXT
|
|
352
354
|
Dir["#{jars}/**/*.jar"].each {|jar| require jar}
|
353
355
|
end
|
354
356
|
|
355
|
-
def
|
357
|
+
def language(lang)
|
356
358
|
require 'gherkin/dialect'
|
357
359
|
|
358
360
|
return indicate_invalid_language_and_exit(lang) unless ::Gherkin::DIALECTS.keys.include? lang
|
@@ -391,7 +393,7 @@ TEXT
|
|
391
393
|
tag_limits[tag_name] = limit
|
392
394
|
end
|
393
395
|
|
394
|
-
def
|
396
|
+
def color(color)
|
395
397
|
Cucumber::Term::ANSIColor.coloring = color
|
396
398
|
end
|
397
399
|
|
@@ -403,7 +405,7 @@ TEXT
|
|
403
405
|
@profiles << p
|
404
406
|
end
|
405
407
|
|
406
|
-
def set_option(option, value=nil)
|
408
|
+
def set_option(option, value = nil)
|
407
409
|
@options[option] = value.nil? ? true : value
|
408
410
|
end
|
409
411
|
|
@@ -553,7 +555,8 @@ TEXT
|
|
553
555
|
data = Cucumber::MultilineArgument::DataTable.from(
|
554
556
|
::Gherkin::DIALECTS.keys.map do |key|
|
555
557
|
[key, ::Gherkin::DIALECTS[key].fetch('name'), ::Gherkin::DIALECTS[key].fetch('native')]
|
556
|
-
end
|
558
|
+
end
|
559
|
+
)
|
557
560
|
@out_stream.write(data.to_s({ color: false, prefixes: Hash.new('') }))
|
558
561
|
Kernel.exit(0)
|
559
562
|
end
|
@@ -573,7 +576,7 @@ TEXT
|
|
573
576
|
:dry_run => false,
|
574
577
|
:formats => [],
|
575
578
|
:excludes => [],
|
576
|
-
:tag_expressions
|
579
|
+
:tag_expressions => [],
|
577
580
|
:tag_limits => {},
|
578
581
|
:name_regexps => [],
|
579
582
|
:env_vars => {},
|
@@ -585,6 +588,5 @@ TEXT
|
|
585
588
|
}
|
586
589
|
end
|
587
590
|
end
|
588
|
-
|
589
591
|
end
|
590
592
|
end
|
@@ -1,11 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'yaml'
|
3
4
|
|
4
5
|
module Cucumber
|
5
6
|
module Cli
|
6
|
-
|
7
7
|
class ProfileLoader
|
8
|
-
|
9
8
|
def initialize
|
10
9
|
@cucumber_yml = nil
|
11
10
|
end
|
@@ -60,7 +59,7 @@ Defined profiles in cucumber.yml:
|
|
60
59
|
def cucumber_yml
|
61
60
|
return @cucumber_yml if @cucumber_yml
|
62
61
|
unless cucumber_yml_defined?
|
63
|
-
raise(ProfilesNotDefinedError,"cucumber.yml was not found. Current directory is #{Dir.pwd}. Please refer to cucumber's documentation on defining profiles in cucumber.yml. You must define a 'default' profile to use the cucumber command without any arguments.\nType 'cucumber --help' for usage.\n")
|
62
|
+
raise(ProfilesNotDefinedError, "cucumber.yml was not found. Current directory is #{Dir.pwd}. Please refer to cucumber's documentation on defining profiles in cucumber.yml. You must define a 'default' profile to use the cucumber command without any arguments.\nType 'cucumber --help' for usage.\n")
|
64
63
|
end
|
65
64
|
|
66
65
|
require 'erb'
|
@@ -68,17 +67,17 @@ Defined profiles in cucumber.yml:
|
|
68
67
|
begin
|
69
68
|
@cucumber_erb = ERB.new(IO.read(cucumber_file), nil, '%').result(binding)
|
70
69
|
rescue StandardError
|
71
|
-
raise(YmlLoadError,"cucumber.yml was found, but could not be parsed with ERB. Please refer to cucumber's documentation on correct profile usage.\n#{$!.inspect}")
|
70
|
+
raise(YmlLoadError, "cucumber.yml was found, but could not be parsed with ERB. Please refer to cucumber's documentation on correct profile usage.\n#{$!.inspect}")
|
72
71
|
end
|
73
72
|
|
74
73
|
begin
|
75
74
|
@cucumber_yml = YAML.load(@cucumber_erb)
|
76
75
|
rescue StandardError
|
77
|
-
raise(YmlLoadError,"cucumber.yml was found, but could not be parsed. Please refer to cucumber's documentation on correct profile usage.\n")
|
76
|
+
raise(YmlLoadError, "cucumber.yml was found, but could not be parsed. Please refer to cucumber's documentation on correct profile usage.\n")
|
78
77
|
end
|
79
78
|
|
80
79
|
if @cucumber_yml.nil? || !@cucumber_yml.is_a?(Hash)
|
81
|
-
raise(YmlLoadError,"cucumber.yml was found, but was blank or malformed. Please refer to cucumber's documentation on correct profile usage.\n")
|
80
|
+
raise(YmlLoadError, "cucumber.yml was found, but was blank or malformed. Please refer to cucumber's documentation on correct profile usage.\n")
|
82
81
|
end
|
83
82
|
|
84
83
|
return @cucumber_yml
|
@@ -90,7 +89,6 @@ Defined profiles in cucumber.yml:
|
|
90
89
|
def cucumber_file
|
91
90
|
@cucumber_file ||= Dir.glob('{,.config/,config/}cucumber{.yml,.yaml}').first
|
92
91
|
end
|
93
|
-
|
94
92
|
end
|
95
93
|
end
|
96
94
|
end
|