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.
@@ -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 # :nodoc:
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 # :nodoc:
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) # :nodoc:
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) # :nodoc:
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) # :nodoc:
353
+ def index(cells)
354
354
  cells_rows.index(cells)
355
355
  end
356
356
 
357
- def verify_column(column_name) # :nodoc:
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) # :nodoc:
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) # :nodoc:
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 # :nodoc:
372
- @rows ||= cell_matrix.map do |cell_row| # rubocop:disable Naming/MemoizedInstanceVariableName
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 # :nodoc:
377
+ def headers
378
378
  raw.first
379
379
  end
380
380
 
381
- def header_cell(col) # :nodoc:
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) # :nodoc:
387
+ def col_width(col)
388
388
  columns[col].__send__(:width)
389
389
  end
390
390
 
391
- def to_s(options = {}) # :nodoc:
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 # :nodoc:
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 # :nodoc:
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) # :nodoc:
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! # :nodoc:
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! # :nodoc:
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! # :nodoc:
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) # :nodoc:
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 # :nodoc:
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 # :nodoc:
540
+ def to_sexp
541
541
  [:row, line, *@cells.map(&:to_sexp)]
542
542
  end
543
543
 
544
- def to_hash # :nodoc:
544
+ def to_hash
545
545
  @to_hash ||= @table.cells_to_hash(self)
546
546
  end
547
547
 
548
- def value(n) # :nodoc:
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 # :nodoc:
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 # :nodoc:
606
+ def to_sexp
607
607
  [:cell, @value]
608
608
  end
609
609
  end
610
610
 
611
- class SurplusCell < Cell # :nodoc:
611
+ class SurplusCell < Cell
612
612
  def status
613
613
  :comment
614
614
  end
@@ -2,11 +2,7 @@
2
2
 
3
3
  require 'cucumber/platform'
4
4
  require 'cucumber/gherkin/formatter/ansi_escapes'
5
- begin
6
- # Support Rake > 0.8.7
7
- require 'rake/dsl_definition'
8
- rescue LoadError
9
- end
5
+ require 'rake/dsl_definition'
10
6
 
11
7
  module Cucumber
12
8
  module Rake
@@ -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 handul of methods needed by 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 instanciate a Cucumber::Messages::Meta message filled-in with
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: informtion about the CI environment if any, including:
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
@@ -235,7 +235,7 @@ module Cucumber
235
235
  end
236
236
 
237
237
  require 'cucumber/core/test/filters'
238
- def filters # rubocop:disable Metrics/AbcSize
238
+ def filters
239
239
  tag_expressions = @configuration.tag_expressions
240
240
  name_regexps = @configuration.name_regexps
241
241
  tag_limits = @configuration.tag_limits