cucumber 9.0.2 → 9.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/README.md +4 -8
- data/VERSION +1 -1
- data/lib/cucumber/cli/main.rb +1 -1
- data/lib/cucumber/cli/options.rb +8 -8
- data/lib/cucumber/cli/profile_loader.rb +5 -5
- data/lib/cucumber/configuration.rb +1 -1
- data/lib/cucumber/deprecate.rb +6 -47
- data/lib/cucumber/formatter/ansicolor.rb +9 -9
- data/lib/cucumber/formatter/ast_lookup.rb +14 -6
- data/lib/cucumber/formatter/console.rb +7 -2
- data/lib/cucumber/formatter/json.rb +2 -2
- data/lib/cucumber/formatter/message_builder.rb +14 -5
- data/lib/cucumber/formatter/pretty.rb +7 -3
- data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +16 -16
- data/lib/cucumber/glue/invoke_in_world.rb +1 -1
- data/lib/cucumber/glue/proto_world.rb +17 -22
- data/lib/cucumber/glue/registry_and_more.rb +7 -4
- data/lib/cucumber/multiline_argument/data_table.rb +28 -28
- data/lib/cucumber/rake/task.rb +1 -5
- data/lib/cucumber/runtime/for_programming_languages.rb +1 -2
- data/lib/cucumber/runtime/meta_message_builder.rb +2 -2
- data/lib/cucumber/runtime/user_interface.rb +2 -2
- data/lib/cucumber/runtime.rb +1 -1
- metadata +35 -241
- data/lib/autotest/cucumber.rb +0 -8
- data/lib/autotest/cucumber_mixin.rb +0 -133
- data/lib/autotest/cucumber_rails.rb +0 -8
- data/lib/autotest/cucumber_rails_rspec.rb +0 -8
- data/lib/autotest/cucumber_rails_rspec2.rb +0 -8
- data/lib/autotest/cucumber_rspec.rb +0 -8
- data/lib/autotest/cucumber_rspec2.rb +0 -8
- data/lib/autotest/discover.rb +0 -14
@@ -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
|
|
@@ -194,7 +194,7 @@ module Cucumber
|
|
194
194
|
end
|
195
195
|
end
|
196
196
|
|
197
|
-
def column_names
|
197
|
+
def column_names
|
198
198
|
@column_names ||= cell_matrix[0].map(&:value)
|
199
199
|
end
|
200
200
|
|
@@ -204,7 +204,7 @@ module Cucumber
|
|
204
204
|
end
|
205
205
|
end
|
206
206
|
|
207
|
-
def each_cells_row(&proc)
|
207
|
+
def each_cells_row(&proc)
|
208
208
|
cells_rows.each(&proc)
|
209
209
|
end
|
210
210
|
|
@@ -340,7 +340,7 @@ module Cucumber
|
|
340
340
|
cells_rows.map { |cells| cells.map(&:value) }
|
341
341
|
end
|
342
342
|
|
343
|
-
def cells_to_hash(cells)
|
343
|
+
def cells_to_hash(cells)
|
344
344
|
hash = Hash.new do |hash_inner, key|
|
345
345
|
hash_inner[key.to_s] if key.is_a?(Symbol)
|
346
346
|
end
|
@@ -350,51 +350,51 @@ module Cucumber
|
|
350
350
|
hash
|
351
351
|
end
|
352
352
|
|
353
|
-
def index(cells)
|
353
|
+
def index(cells)
|
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
|
|
365
365
|
# TODO: remove the below function if it's not actually being used.
|
366
366
|
# Nothing else in this repo calls it.
|
367
|
-
def text?(text)
|
367
|
+
def text?(text)
|
368
368
|
raw.flatten.compact.detect { |cell_value| cell_value.index(text) }
|
369
369
|
end
|
370
370
|
|
371
|
-
def cells_rows
|
372
|
-
@rows ||= cell_matrix.map do |cell_row|
|
371
|
+
def cells_rows
|
372
|
+
@rows ||= cell_matrix.map do |cell_row|
|
373
373
|
Cells.new(self, cell_row)
|
374
374
|
end
|
375
375
|
end
|
376
376
|
|
377
|
-
def headers
|
377
|
+
def headers
|
378
378
|
raw.first
|
379
379
|
end
|
380
380
|
|
381
|
-
def header_cell(col)
|
381
|
+
def header_cell(col)
|
382
382
|
cells_rows[0][col]
|
383
383
|
end
|
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
|
|
@@ -537,15 +537,15 @@ module Cucumber
|
|
537
537
|
end
|
538
538
|
|
539
539
|
# For testing only
|
540
|
-
def to_sexp
|
540
|
+
def to_sexp
|
541
541
|
[:row, line, *@cells.map(&:to_sexp)]
|
542
542
|
end
|
543
543
|
|
544
|
-
def to_hash
|
544
|
+
def to_hash
|
545
545
|
@to_hash ||= @table.cells_to_hash(self)
|
546
546
|
end
|
547
547
|
|
548
|
-
def value(n)
|
548
|
+
def value(n)
|
549
549
|
self[n].value
|
550
550
|
end
|
551
551
|
|
@@ -576,7 +576,7 @@ module Cucumber
|
|
576
576
|
end
|
577
577
|
end
|
578
578
|
|
579
|
-
class Cell
|
579
|
+
class Cell
|
580
580
|
attr_reader :line, :table
|
581
581
|
attr_accessor :status, :value
|
582
582
|
|
@@ -603,12 +603,12 @@ module Cucumber
|
|
603
603
|
end
|
604
604
|
|
605
605
|
# For testing only
|
606
|
-
def to_sexp
|
606
|
+
def to_sexp
|
607
607
|
[:cell, @value]
|
608
608
|
end
|
609
609
|
end
|
610
610
|
|
611
|
-
class SurplusCell < Cell
|
611
|
+
class SurplusCell < Cell
|
612
612
|
def status
|
613
613
|
:comment
|
614
614
|
end
|
data/lib/cucumber/rake/task.rb
CHANGED
@@ -7,8 +7,7 @@ module Cucumber
|
|
7
7
|
class Runtime
|
8
8
|
# This is what a programming language will consider to be a runtime.
|
9
9
|
#
|
10
|
-
# It's a thin class that directs the
|
11
|
-
# programming languages to the right place.
|
10
|
+
# It's a thin class that directs the handful of methods needed by the programming languages to the right place
|
12
11
|
class ForProgrammingLanguages
|
13
12
|
extend Forwardable
|
14
13
|
|
@@ -5,14 +5,14 @@ require 'cucumber/ci_environment'
|
|
5
5
|
|
6
6
|
module Cucumber
|
7
7
|
class Runtime
|
8
|
-
# Builder to
|
8
|
+
# Builder to instantiate a Cucumber::Messages::Meta message filled-in with
|
9
9
|
# the runtime meta-data:
|
10
10
|
# - protocol version: the version of the Cucumber::Messages protocol
|
11
11
|
# - implementation: the name and version of the implementation (e.g. cucumber-ruby 8.0.0)
|
12
12
|
# - runtime: the name and version of the runtime (e.g. ruby 3.0.1)
|
13
13
|
# - os: the name and version of the operating system (e.g. linux 3.13.0-45-generic)
|
14
14
|
# - cpu: the name of the CPU (e.g. x86_64)
|
15
|
-
# - ci:
|
15
|
+
# - ci: information about the CI environment if any, including:
|
16
16
|
# - name: the name of the CI environment (e.g. Jenkins)
|
17
17
|
# - url: the URL of the CI environment (e.g. https://ci.example.com)
|
18
18
|
# - build_number: the build number of the CI environment (e.g. 123)
|
@@ -41,8 +41,8 @@ module Cucumber
|
|
41
41
|
# be a path to a file, or if it's an image it may also be a Base64 encoded image.
|
42
42
|
# The embedded data may or may not be ignored, depending on what kind of formatter(s) are active.
|
43
43
|
#
|
44
|
-
def attach(src, media_type)
|
45
|
-
@visitor.attach(src, media_type)
|
44
|
+
def attach(src, media_type, filename)
|
45
|
+
@visitor.attach(src, media_type, filename)
|
46
46
|
end
|
47
47
|
|
48
48
|
private
|
data/lib/cucumber/runtime.rb
CHANGED
@@ -235,7 +235,7 @@ module Cucumber
|
|
235
235
|
end
|
236
236
|
|
237
237
|
require 'cucumber/core/test/filters'
|
238
|
-
def filters
|
238
|
+
def filters
|
239
239
|
tag_expressions = @configuration.tag_expressions
|
240
240
|
name_regexps = @configuration.name_regexps
|
241
241
|
tag_limits = @configuration.tag_limits
|