cucumber 9.1.1 → 9.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/cucumber/cli/options.rb +29 -29
- data/lib/cucumber/formatter/ansicolor.rb +9 -17
- data/lib/cucumber/formatter/console.rb +7 -7
- data/lib/cucumber/formatter/json.rb +1 -5
- data/lib/cucumber/formatter/junit.rb +1 -1
- data/lib/cucumber/formatter/message_builder.rb +5 -1
- data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +3 -4
- data/lib/cucumber/multiline_argument/data_table.rb +23 -24
- data/lib/cucumber/running_test_case.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d937b723774ea37f4739f86d3888163faec44b5e815b344c3cb7c8cd2dae8b42
|
4
|
+
data.tar.gz: e7cc47f9e50d7d355baacc10594db8e93b7a3dc961a8b43417c21e11a664929d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 104816fd17fed2d4302d43ecfe1d72465a0b863cf79f449ecc44c25bcc6fe8c00824f0f07014fa0b3986f1476f3ab490c5bb36f9f6b9676715e342682d4c3c40
|
7
|
+
data.tar.gz: 06cdb6fd33a1347415e85590658a0972243798bf653eb3b2a23bc65b5d2d25fccf39b48e85024d2b58ad3868d86f05630a77c719dd6b244def9741eb04736ced
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
9.1.
|
1
|
+
9.1.2
|
data/lib/cucumber/cli/options.rb
CHANGED
@@ -12,26 +12,26 @@ module Cucumber
|
|
12
12
|
CUCUMBER_PUBLISH_URL = ENV['CUCUMBER_PUBLISH_URL'] || 'https://messages.cucumber.io/api/reports -X GET'
|
13
13
|
INDENT = ' ' * 53
|
14
14
|
BUILTIN_FORMATS = {
|
15
|
-
'pretty'
|
16
|
-
'progress'
|
17
|
-
'rerun'
|
18
|
-
'usage'
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
'stepdefs'
|
24
|
-
|
25
|
-
'junit'
|
26
|
-
|
27
|
-
'json'
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
'message'
|
33
|
-
'html'
|
34
|
-
'summary'
|
15
|
+
'pretty' => ['Cucumber::Formatter::Pretty', 'Prints the feature as is - in colours.'],
|
16
|
+
'progress' => ['Cucumber::Formatter::Progress', 'Prints one character per scenario.'],
|
17
|
+
'rerun' => ['Cucumber::Formatter::Rerun', 'Prints failing files with line numbers.'],
|
18
|
+
'usage' => ['Cucumber::Formatter::Usage', "Prints where step definitions are used.\n" \
|
19
|
+
"#{INDENT}The slowest step definitions (with duration) are\n" \
|
20
|
+
"#{INDENT}listed first. If --dry-run is used the duration\n" \
|
21
|
+
"#{INDENT}is not shown, and step definitions are sorted by\n" \
|
22
|
+
"#{INDENT}filename instead."],
|
23
|
+
'stepdefs' => ['Cucumber::Formatter::Stepdefs', "Prints All step definitions with their locations. Same as\n" \
|
24
|
+
"#{INDENT}the usage formatter, except that steps are not printed."],
|
25
|
+
'junit' => ['Cucumber::Formatter::Junit', "Generates a report similar to Ant+JUnit. Use\n" \
|
26
|
+
"#{INDENT}junit,fileattribute=true to include a file attribute."],
|
27
|
+
'json' => ['Cucumber::Formatter::Json', "Prints the feature as JSON.\n" \
|
28
|
+
"#{INDENT}The JSON format is in maintenance mode.\n" \
|
29
|
+
"#{INDENT}Please consider using the message formatter\n"\
|
30
|
+
"#{INDENT}with the standalone json-formatter\n" \
|
31
|
+
"#{INDENT}(https://github.com/cucumber/cucumber/tree/master/json-formatter)."],
|
32
|
+
'message' => ['Cucumber::Formatter::Message', 'Prints each message in NDJSON form, which can then be consumed by other tools.'],
|
33
|
+
'html' => ['Cucumber::Formatter::HTML', 'Outputs HTML report'],
|
34
|
+
'summary' => ['Cucumber::Formatter::Summary', 'Summary output of feature and scenarios']
|
35
35
|
}.freeze
|
36
36
|
max = BUILTIN_FORMATS.keys.map(&:length).max
|
37
37
|
FORMAT_HELP_MSG = [
|
@@ -295,9 +295,9 @@ module Cucumber
|
|
295
295
|
]
|
296
296
|
end
|
297
297
|
|
298
|
-
def parse_formats(
|
299
|
-
formatter, *formatter_options =
|
300
|
-
options_hash = Hash[formatter_options.map { |
|
298
|
+
def parse_formats(value)
|
299
|
+
formatter, *formatter_options = value.split(',')
|
300
|
+
options_hash = Hash[formatter_options.map { |string| string.split('=') }]
|
301
301
|
[formatter, options_hash]
|
302
302
|
end
|
303
303
|
|
@@ -375,12 +375,12 @@ module Cucumber
|
|
375
375
|
].join("\n")
|
376
376
|
end
|
377
377
|
|
378
|
-
def require_files(
|
379
|
-
@options[:require] <<
|
380
|
-
return unless Cucumber::JRUBY && File.directory?(
|
378
|
+
def require_files(filenames)
|
379
|
+
@options[:require] << filenames
|
380
|
+
return unless Cucumber::JRUBY && File.directory?(filenames)
|
381
381
|
|
382
382
|
require 'java'
|
383
|
-
$CLASSPATH <<
|
383
|
+
$CLASSPATH << filenames
|
384
384
|
end
|
385
385
|
|
386
386
|
def require_jars(jars)
|
@@ -441,8 +441,8 @@ module Cucumber
|
|
441
441
|
ProjectInitializer.new.run && Kernel.exit(0)
|
442
442
|
end
|
443
443
|
|
444
|
-
def add_profile(
|
445
|
-
@profiles <<
|
444
|
+
def add_profile(profile)
|
445
|
+
@profiles << profile
|
446
446
|
end
|
447
447
|
|
448
448
|
def set_option(option, value = nil)
|
@@ -63,7 +63,6 @@ module Cucumber
|
|
63
63
|
module ANSIColor
|
64
64
|
include Cucumber::Term::ANSIColor
|
65
65
|
|
66
|
-
# :stopdoc:
|
67
66
|
ALIASES = Hash.new do |h, k|
|
68
67
|
next unless k.to_s =~ /(.*)_param/
|
69
68
|
|
@@ -79,13 +78,8 @@ module Cucumber
|
|
79
78
|
'comment' => 'grey',
|
80
79
|
'tag' => 'cyan'
|
81
80
|
)
|
82
|
-
# :startdoc:
|
83
81
|
|
84
|
-
# Apply the custom color scheme
|
85
|
-
#
|
86
|
-
# example:
|
87
|
-
#
|
88
|
-
# apply_custom_colors('passed=white')
|
82
|
+
# Apply the custom color scheme -> i.e. apply_custom_colors('passed=white')
|
89
83
|
def self.apply_custom_colors(colors)
|
90
84
|
colors.split(':').each do |pair|
|
91
85
|
a = pair.split('=')
|
@@ -117,23 +111,21 @@ module Cucumber
|
|
117
111
|
end
|
118
112
|
end
|
119
113
|
|
120
|
-
|
121
|
-
|
122
|
-
('(::) ' * n).strip
|
114
|
+
def cukes(amount)
|
115
|
+
('(::) ' * amount).strip
|
123
116
|
end
|
124
117
|
|
125
|
-
def green_cukes(
|
126
|
-
blink(green(cukes(
|
118
|
+
def green_cukes(amount)
|
119
|
+
blink(green(cukes(amount)))
|
127
120
|
end
|
128
121
|
|
129
|
-
def red_cukes(
|
130
|
-
blink(red(cukes(
|
122
|
+
def red_cukes(amount)
|
123
|
+
blink(red(cukes(amount)))
|
131
124
|
end
|
132
125
|
|
133
|
-
def yellow_cukes(
|
134
|
-
blink(yellow(cukes(
|
126
|
+
def yellow_cukes(amount)
|
127
|
+
blink(yellow(cukes(amount)))
|
135
128
|
end
|
136
|
-
# :startdoc:
|
137
129
|
|
138
130
|
private
|
139
131
|
|
@@ -43,9 +43,9 @@ module Cucumber
|
|
43
43
|
format_string(line, status)
|
44
44
|
end
|
45
45
|
|
46
|
-
def format_string(
|
46
|
+
def format_string(input, status)
|
47
47
|
fmt = format_for(status)
|
48
|
-
|
48
|
+
input.to_s.split("\n").map do |line|
|
49
49
|
if fmt.instance_of?(Proc)
|
50
50
|
fmt.call(line)
|
51
51
|
else
|
@@ -92,16 +92,16 @@ module Cucumber
|
|
92
92
|
@io.flush
|
93
93
|
end
|
94
94
|
|
95
|
-
def print_exception(
|
96
|
-
string = exception_message_string(
|
95
|
+
def print_exception(exception, status, indent)
|
96
|
+
string = exception_message_string(exception, indent)
|
97
97
|
@io.puts(format_string(string, status))
|
98
98
|
end
|
99
99
|
|
100
|
-
def exception_message_string(
|
101
|
-
message = "#{
|
100
|
+
def exception_message_string(exception, indent_amount)
|
101
|
+
message = "#{exception.message} (#{exception.class})".dup.force_encoding('UTF-8')
|
102
102
|
message = linebreaks(message, ENV['CUCUMBER_TRUNCATE_OUTPUT'].to_i)
|
103
103
|
|
104
|
-
indent("#{message}\n#{
|
104
|
+
indent("#{message}\n#{exception.backtrace.join("\n")}", indent_amount)
|
105
105
|
end
|
106
106
|
|
107
107
|
# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/10655
|
@@ -102,7 +102,7 @@ module Cucumber
|
|
102
102
|
private
|
103
103
|
|
104
104
|
def same_feature_as_previous_test_case?(test_case)
|
105
|
-
|
105
|
+
@feature_hash&.fetch(:uri, nil) == test_case.location.file
|
106
106
|
end
|
107
107
|
|
108
108
|
def first_step_after_background?(test_step)
|
@@ -113,10 +113,6 @@ module Cucumber
|
|
113
113
|
test_step.location.file.include?('lib/cucumber/')
|
114
114
|
end
|
115
115
|
|
116
|
-
def current_feature
|
117
|
-
@feature_hash ||= {}
|
118
|
-
end
|
119
|
-
|
120
116
|
def feature_elements
|
121
117
|
@feature_hash[:elements] ||= []
|
122
118
|
end
|
@@ -132,7 +132,7 @@ module Cucumber
|
|
132
132
|
@step_definitions_by_test_step.step_match_arguments(step).map do |argument|
|
133
133
|
Cucumber::Messages::StepMatchArgument.new(
|
134
134
|
group: argument_group_to_message(argument.group),
|
135
|
-
parameter_type_name: argument
|
135
|
+
parameter_type_name: parameter_type_name(argument)
|
136
136
|
)
|
137
137
|
end
|
138
138
|
end
|
@@ -145,6 +145,10 @@ module Cucumber
|
|
145
145
|
)
|
146
146
|
end
|
147
147
|
|
148
|
+
def parameter_type_name(step_match_argument)
|
149
|
+
step_match_argument.parameter_type&.name if step_match_argument.respond_to?(:parameter_type)
|
150
|
+
end
|
151
|
+
|
148
152
|
def on_test_run_started(*)
|
149
153
|
message = Cucumber::Messages::Envelope.new(
|
150
154
|
test_run_started: Cucumber::Messages::TestRunStarted.new(
|
@@ -5,8 +5,7 @@ module Cucumber
|
|
5
5
|
module Formatter
|
6
6
|
# Defines aliases for ANSI coloured output. Default colours can be overridden by defining
|
7
7
|
# a <tt>GHERKIN_COLORS</tt> variable in your shell, very much like how you can
|
8
|
-
# tweak the familiar POSIX command <tt>ls</tt> with
|
9
|
-
# $LSCOLORS: http://linux-sxs.org/housekeeping/lscolors.html
|
8
|
+
# tweak the familiar POSIX command <tt>ls</tt> with $LSCOLORS: http://linux-sxs.org/housekeeping/lscolors.html
|
10
9
|
#
|
11
10
|
# The colours that you can change are:
|
12
11
|
#
|
@@ -87,8 +86,8 @@ module Cucumber
|
|
87
86
|
"\e[0m"
|
88
87
|
end
|
89
88
|
|
90
|
-
def up(
|
91
|
-
"\e[#{
|
89
|
+
def up(amount)
|
90
|
+
"\e[#{amount}A"
|
92
91
|
end
|
93
92
|
end
|
94
93
|
end
|
@@ -27,7 +27,7 @@ module Cucumber
|
|
27
27
|
# This will store <tt>[['a', 'b'], ['c', 'd']]</tt> in the <tt>data</tt> variable.
|
28
28
|
#
|
29
29
|
class DataTable
|
30
|
-
def self.default_arg_name
|
30
|
+
def self.default_arg_name
|
31
31
|
'table'
|
32
32
|
end
|
33
33
|
|
@@ -200,7 +200,7 @@ module Cucumber
|
|
200
200
|
|
201
201
|
def rows
|
202
202
|
hashes.map do |hash|
|
203
|
-
hash.values_at
|
203
|
+
hash.values_at(*headers)
|
204
204
|
end
|
205
205
|
end
|
206
206
|
|
@@ -354,11 +354,11 @@ module Cucumber
|
|
354
354
|
cells_rows.index(cells)
|
355
355
|
end
|
356
356
|
|
357
|
-
def verify_column(column_name)
|
357
|
+
def verify_column(column_name)
|
358
358
|
raise %(The column named "#{column_name}" does not exist) unless raw[0].include?(column_name)
|
359
359
|
end
|
360
360
|
|
361
|
-
def verify_table_width(width)
|
361
|
+
def verify_table_width(width)
|
362
362
|
raise %(The table must have exactly #{width} columns) unless raw[0].size == width
|
363
363
|
end
|
364
364
|
|
@@ -384,17 +384,17 @@ module Cucumber
|
|
384
384
|
|
385
385
|
attr_reader :cell_matrix
|
386
386
|
|
387
|
-
def col_width(col)
|
387
|
+
def col_width(col)
|
388
388
|
columns[col].__send__(:width)
|
389
389
|
end
|
390
390
|
|
391
|
-
def to_s(options = {})
|
391
|
+
def to_s(options = {})
|
392
392
|
indentation = options.key?(:indent) ? options[:indent] : 2
|
393
393
|
prefixes = options.key?(:prefixes) ? options[:prefixes] : TO_S_PREFIXES
|
394
394
|
DataTablePrinter.new(self, indentation, prefixes).to_s
|
395
395
|
end
|
396
396
|
|
397
|
-
class DataTablePrinter
|
397
|
+
class DataTablePrinter
|
398
398
|
include Cucumber::Gherkin::Formatter::Escaping
|
399
399
|
attr_reader :data_table, :indentation, :prefixes
|
400
400
|
private :data_table, :indentation, :prefixes
|
@@ -433,7 +433,7 @@ module Cucumber
|
|
433
433
|
end
|
434
434
|
end
|
435
435
|
|
436
|
-
def columns
|
436
|
+
def columns
|
437
437
|
@columns ||= cell_matrix.transpose.map do |cell_row|
|
438
438
|
Cells.new(self, cell_row)
|
439
439
|
end
|
@@ -456,7 +456,7 @@ module Cucumber
|
|
456
456
|
cells_rows[1..].map(&:to_hash)
|
457
457
|
end
|
458
458
|
|
459
|
-
def create_cell_matrix(ast_table)
|
459
|
+
def create_cell_matrix(ast_table)
|
460
460
|
ast_table.raw.map do |raw_row|
|
461
461
|
line = begin
|
462
462
|
raw_row.line
|
@@ -469,7 +469,7 @@ module Cucumber
|
|
469
469
|
end
|
470
470
|
end
|
471
471
|
|
472
|
-
def convert_columns!
|
472
|
+
def convert_columns!
|
473
473
|
@conversion_procs.each do |column_name, conversion_proc|
|
474
474
|
verify_column(column_name) if conversion_proc[:strict]
|
475
475
|
end
|
@@ -483,7 +483,7 @@ module Cucumber
|
|
483
483
|
end
|
484
484
|
end
|
485
485
|
|
486
|
-
def convert_headers!
|
486
|
+
def convert_headers!
|
487
487
|
header_cells = cell_matrix[0]
|
488
488
|
|
489
489
|
if @header_conversion_proc
|
@@ -501,11 +501,11 @@ module Cucumber
|
|
501
501
|
end
|
502
502
|
end
|
503
503
|
|
504
|
-
def clear_cache!
|
504
|
+
def clear_cache!
|
505
505
|
@hashes = @rows_hash = @column_names = @rows = @columns = nil
|
506
506
|
end
|
507
507
|
|
508
|
-
def ensure_table(table_or_array)
|
508
|
+
def ensure_table(table_or_array)
|
509
509
|
return table_or_array if table_or_array.instance_of?(DataTable)
|
510
510
|
|
511
511
|
DataTable.from(table_or_array)
|
@@ -516,7 +516,7 @@ module Cucumber
|
|
516
516
|
end
|
517
517
|
|
518
518
|
# Represents a row of cells or columns of cells
|
519
|
-
class Cells
|
519
|
+
class Cells
|
520
520
|
include Enumerable
|
521
521
|
include Cucumber::Gherkin::Formatter::Escaping
|
522
522
|
|
@@ -536,21 +536,20 @@ module Cucumber
|
|
536
536
|
nil
|
537
537
|
end
|
538
538
|
|
539
|
-
|
540
|
-
def to_sexp
|
539
|
+
def to_sexp
|
541
540
|
[:row, line, *@cells.map(&:to_sexp)]
|
542
541
|
end
|
543
542
|
|
544
|
-
def to_hash
|
543
|
+
def to_hash
|
545
544
|
@to_hash ||= @table.cells_to_hash(self)
|
546
545
|
end
|
547
546
|
|
548
|
-
def value(
|
549
|
-
self[
|
547
|
+
def value(index)
|
548
|
+
self[index].value
|
550
549
|
end
|
551
550
|
|
552
|
-
def [](
|
553
|
-
@cells[
|
551
|
+
def [](index)
|
552
|
+
@cells[index]
|
554
553
|
end
|
555
554
|
|
556
555
|
def line
|
@@ -576,7 +575,7 @@ module Cucumber
|
|
576
575
|
end
|
577
576
|
end
|
578
577
|
|
579
|
-
class Cell
|
578
|
+
class Cell
|
580
579
|
attr_reader :line, :table
|
581
580
|
attr_accessor :status, :value
|
582
581
|
|
@@ -603,12 +602,12 @@ module Cucumber
|
|
603
602
|
end
|
604
603
|
|
605
604
|
# For testing only
|
606
|
-
def to_sexp
|
605
|
+
def to_sexp
|
607
606
|
[:cell, @value]
|
608
607
|
end
|
609
608
|
end
|
610
609
|
|
611
|
-
class SurplusCell < Cell
|
610
|
+
class SurplusCell < Cell
|
612
611
|
def status
|
613
612
|
:comment
|
614
613
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.1.
|
4
|
+
version: 9.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aslak Hellesøy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-01-
|
13
|
+
date: 2024-01-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: builder
|
@@ -220,14 +220,14 @@ dependencies:
|
|
220
220
|
requirements:
|
221
221
|
- - "~>"
|
222
222
|
- !ruby/object:Gem::Version
|
223
|
-
version: '
|
223
|
+
version: '15.0'
|
224
224
|
type: :development
|
225
225
|
prerelease: false
|
226
226
|
version_requirements: !ruby/object:Gem::Requirement
|
227
227
|
requirements:
|
228
228
|
- - "~>"
|
229
229
|
- !ruby/object:Gem::Version
|
230
|
-
version: '
|
230
|
+
version: '15.0'
|
231
231
|
- !ruby/object:Gem::Dependency
|
232
232
|
name: nokogiri
|
233
233
|
requirement: !ruby/object:Gem::Requirement
|
@@ -529,5 +529,5 @@ requirements: []
|
|
529
529
|
rubygems_version: 3.3.5
|
530
530
|
signing_key:
|
531
531
|
specification_version: 4
|
532
|
-
summary: cucumber-9.1.
|
532
|
+
summary: cucumber-9.1.2
|
533
533
|
test_files: []
|