cucumber 8.0.0 → 9.2.0
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 +14 -23
 - data/VERSION +1 -0
 - data/lib/cucumber/cli/main.rb +1 -1
 - data/lib/cucumber/cli/options.rb +66 -66
 - data/lib/cucumber/cli/profile_loader.rb +5 -5
 - data/lib/cucumber/configuration.rb +7 -2
 - data/lib/cucumber/deprecate.rb +6 -47
 - data/lib/cucumber/errors.rb +2 -1
 - data/lib/cucumber/events/envelope.rb +2 -0
 - data/lib/cucumber/events/gherkin_source_parsed.rb +2 -0
 - data/lib/cucumber/events/gherkin_source_read.rb +2 -0
 - data/lib/cucumber/events/test_case_finished.rb +2 -0
 - data/lib/cucumber/events/test_case_started.rb +2 -0
 - data/lib/cucumber/events/test_step_finished.rb +2 -0
 - data/lib/cucumber/events/test_step_started.rb +2 -0
 - data/lib/cucumber/events/undefined_parameter_type.rb +2 -0
 - data/lib/cucumber/file_specs.rb +1 -1
 - data/lib/cucumber/filters/retry.rb +20 -1
 - data/lib/cucumber/formatter/ansicolor.rb +19 -27
 - data/lib/cucumber/formatter/ast_lookup.rb +14 -6
 - data/lib/cucumber/formatter/console.rb +16 -14
 - data/lib/cucumber/formatter/console_counts.rb +3 -1
 - data/lib/cucumber/formatter/console_issues.rb +4 -2
 - data/lib/cucumber/formatter/curl_option_parser.rb +49 -0
 - data/lib/cucumber/formatter/errors.rb +2 -0
 - data/lib/cucumber/formatter/fail_fast.rb +1 -1
 - data/lib/cucumber/formatter/html.rb +2 -0
 - data/lib/cucumber/formatter/http_io.rb +10 -142
 - data/lib/cucumber/formatter/io_http_buffer.rb +88 -0
 - data/lib/cucumber/formatter/json.rb +2 -6
 - data/lib/cucumber/formatter/junit.rb +4 -4
 - data/lib/cucumber/formatter/message_builder.rb +21 -6
 - data/lib/cucumber/formatter/pretty.rb +9 -5
 - data/lib/cucumber/formatter/publish_banner_printer.rb +0 -2
 - data/lib/cucumber/formatter/query/hook_by_test_step.rb +2 -0
 - data/lib/cucumber/formatter/query/pickle_by_test.rb +2 -0
 - data/lib/cucumber/formatter/query/pickle_step_by_test_step.rb +2 -0
 - data/lib/cucumber/formatter/query/step_definitions_by_test_step.rb +2 -0
 - data/lib/cucumber/formatter/query/test_case_started_by_test_case.rb +2 -0
 - data/lib/cucumber/formatter/rerun.rb +3 -3
 - data/lib/cucumber/formatter/unicode.rb +3 -3
 - data/lib/cucumber/formatter/url_reporter.rb +3 -1
 - data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +23 -25
 - data/lib/cucumber/glue/invoke_in_world.rb +2 -2
 - data/lib/cucumber/glue/proto_world.rb +20 -25
 - data/lib/cucumber/glue/registry_and_more.rb +9 -5
 - data/lib/cucumber/glue/snippet.rb +4 -2
 - data/lib/cucumber/glue/world_factory.rb +2 -0
 - data/lib/cucumber/multiline_argument/data_table/diff_matrices.rb +2 -0
 - data/lib/cucumber/multiline_argument/data_table.rb +34 -35
 - data/lib/cucumber/platform.rb +11 -16
 - data/lib/cucumber/rake/task.rb +2 -6
 - data/lib/cucumber/running_test_case.rb +1 -1
 - data/lib/cucumber/runtime/for_programming_languages.rb +1 -2
 - data/lib/cucumber/runtime/meta_message_builder.rb +4 -2
 - data/lib/cucumber/runtime/user_interface.rb +2 -2
 - data/lib/cucumber/runtime.rb +5 -5
 - data/lib/cucumber/step_match.rb +1 -1
 - data/lib/cucumber/term/ansicolor.rb +1 -1
 - data/lib/cucumber/term/banner.rb +2 -0
 - metadata +83 -239
 - data/CHANGELOG.md +0 -3231
 - data/CONTRIBUTING.md +0 -246
 - 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
 - data/lib/cucumber/version +0 -1
 
    
        data/lib/cucumber/platform.rb
    CHANGED
    
    | 
         @@ -1,27 +1,22 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # frozen_string_literal: true
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
            # Detect the platform we're running on so we can tweak behaviour
         
     | 
| 
       4 
     | 
    
         
            -
            # in various places.
         
     | 
| 
      
 3 
     | 
    
         
            +
            # Detect the platform we're running on so we can tweak behaviour in various places.
         
     | 
| 
       5 
4 
     | 
    
         
             
            require 'rbconfig'
         
     | 
| 
       6 
5 
     | 
    
         
             
            require 'cucumber/core/platform'
         
     | 
| 
       7 
6 
     | 
    
         | 
| 
       8 
7 
     | 
    
         
             
            module Cucumber
         
     | 
| 
       9 
     | 
    
         
            -
               
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
                RAILS         = defined?(Rails)
         
     | 
| 
       14 
     | 
    
         
            -
                RUBY_BINARY   = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
         
     | 
| 
       15 
     | 
    
         
            -
                RUBY          = defined? RUBY_VERSION
         
     | 
| 
      
 8 
     | 
    
         
            +
              VERSION       = File.read(File.expand_path('../../VERSION', __dir__)).strip
         
     | 
| 
      
 9 
     | 
    
         
            +
              BINARY        = File.expand_path("#{File.dirname(__FILE__)}/../../bin/cucumber")
         
     | 
| 
      
 10 
     | 
    
         
            +
              LIBDIR        = File.expand_path("#{File.dirname(__FILE__)}/../../lib")
         
     | 
| 
      
 11 
     | 
    
         
            +
              RUBY_BINARY   = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
         
     | 
| 
       16 
12 
     | 
    
         | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
      
 13 
     | 
    
         
            +
              class << self
         
     | 
| 
      
 14 
     | 
    
         
            +
                attr_accessor :use_full_backtrace
         
     | 
| 
       19 
15 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
                  end
         
     | 
| 
      
 16 
     | 
    
         
            +
                # @private
         
     | 
| 
      
 17 
     | 
    
         
            +
                def file_mode(mode, encoding = 'UTF-8')
         
     | 
| 
      
 18 
     | 
    
         
            +
                  "#{mode}:#{encoding}"
         
     | 
| 
       24 
19 
     | 
    
         
             
                end
         
     | 
| 
       25 
     | 
    
         
            -
                self.use_full_backtrace = false
         
     | 
| 
       26 
20 
     | 
    
         
             
              end
         
     | 
| 
      
 21 
     | 
    
         
            +
              self.use_full_backtrace = false
         
     | 
| 
       27 
22 
     | 
    
         
             
            end
         
     | 
    
        data/lib/cucumber/rake/task.rb
    CHANGED
    
    | 
         @@ -2,11 +2,7 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            require 'cucumber/platform'
         
     | 
| 
       4 
4 
     | 
    
         
             
            require 'cucumber/gherkin/formatter/ansi_escapes'
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       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
         
     | 
| 
         @@ -163,7 +159,7 @@ module Cucumber 
     | 
|
| 
       163 
159 
     | 
    
         
             
                  end
         
     | 
| 
       164 
160 
     | 
    
         | 
| 
       165 
161 
     | 
    
         
             
                  def runner(_task_args = nil) # :nodoc:
         
     | 
| 
       166 
     | 
    
         
            -
                    cucumber_opts = [ 
     | 
| 
      
 162 
     | 
    
         
            +
                    cucumber_opts = [ENV['CUCUMBER_OPTS']&.split(/\s+/) || cucumber_opts_with_profile]
         
     | 
| 
       167 
163 
     | 
    
         
             
                    return ForkedCucumberRunner.new(libs, binary, cucumber_opts, bundler, feature_files) if fork
         
     | 
| 
       168 
164 
     | 
    
         | 
| 
       169 
165 
     | 
    
         
             
                    InProcessCucumberRunner.new(libs, cucumber_opts, feature_files)
         
     | 
| 
         @@ -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 
     | 
    
         | 
| 
         @@ -1,16 +1,18 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       1 
3 
     | 
    
         
             
            require 'cucumber/messages'
         
     | 
| 
       2 
4 
     | 
    
         
             
            require 'cucumber/ci_environment'
         
     | 
| 
       3 
5 
     | 
    
         | 
| 
       4 
6 
     | 
    
         
             
            module Cucumber
         
     | 
| 
       5 
7 
     | 
    
         
             
              class Runtime
         
     | 
| 
       6 
     | 
    
         
            -
                # Builder to  
     | 
| 
      
 8 
     | 
    
         
            +
                # Builder to instantiate a Cucumber::Messages::Meta message filled-in with
         
     | 
| 
       7 
9 
     | 
    
         
             
                # the runtime meta-data:
         
     | 
| 
       8 
10 
     | 
    
         
             
                # - protocol version: the version of the Cucumber::Messages protocol
         
     | 
| 
       9 
11 
     | 
    
         
             
                # - implementation: the name and version of the implementation (e.g. cucumber-ruby 8.0.0)
         
     | 
| 
       10 
12 
     | 
    
         
             
                # - runtime: the name and version of the runtime (e.g. ruby 3.0.1)
         
     | 
| 
       11 
13 
     | 
    
         
             
                # - os: the name and version of the operating system (e.g. linux 3.13.0-45-generic)
         
     | 
| 
       12 
14 
     | 
    
         
             
                # - cpu: the name of the CPU (e.g. x86_64)
         
     | 
| 
       13 
     | 
    
         
            -
                # - ci:  
     | 
| 
      
 15 
     | 
    
         
            +
                # - ci: information about the CI environment if any, including:
         
     | 
| 
       14 
16 
     | 
    
         
             
                #   - name: the name of the CI environment (e.g. Jenkins)
         
     | 
| 
       15 
17 
     | 
    
         
             
                #   - url: the URL of the CI environment (e.g. https://ci.example.com)
         
     | 
| 
       16 
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
    
    | 
         @@ -112,9 +112,9 @@ module Cucumber 
     | 
|
| 
       112 
112 
     | 
    
         | 
| 
       113 
113 
     | 
    
         
             
                def failure?
         
     | 
| 
       114 
114 
     | 
    
         
             
                  if @configuration.wip?
         
     | 
| 
       115 
     | 
    
         
            -
                    summary_report.test_cases.total_passed 
     | 
| 
      
 115 
     | 
    
         
            +
                    summary_report.test_cases.total_passed.positive?
         
     | 
| 
       116 
116 
     | 
    
         
             
                  else
         
     | 
| 
       117 
     | 
    
         
            -
                    !summary_report.ok?(@configuration.strict)
         
     | 
| 
      
 117 
     | 
    
         
            +
                    !summary_report.ok?(strict: @configuration.strict)
         
     | 
| 
       118 
118 
     | 
    
         
             
                  end
         
     | 
| 
       119 
119 
     | 
    
         
             
                end
         
     | 
| 
       120 
120 
     | 
    
         | 
| 
         @@ -150,8 +150,8 @@ module Cucumber 
     | 
|
| 
       150 
150 
     | 
    
         
             
                end
         
     | 
| 
       151 
151 
     | 
    
         | 
| 
       152 
152 
     | 
    
         
             
                class NormalisedEncodingFile
         
     | 
| 
       153 
     | 
    
         
            -
                  COMMENT_OR_EMPTY_LINE_PATTERN = /^\s*#|^\s 
     | 
| 
       154 
     | 
    
         
            -
                  ENCODING_PATTERN = /^\s*#\s*encoding\s*:\s*([^\s]+) 
     | 
| 
      
 153 
     | 
    
         
            +
                  COMMENT_OR_EMPTY_LINE_PATTERN = /^\s*#|^\s*$/.freeze # :nodoc:
         
     | 
| 
      
 154 
     | 
    
         
            +
                  ENCODING_PATTERN = /^\s*#\s*encoding\s*:\s*([^\s]+)/.freeze # :nodoc:
         
     | 
| 
       155 
155 
     | 
    
         | 
| 
       156 
156 
     | 
    
         
             
                  def self.read(path)
         
     | 
| 
       157 
157 
     | 
    
         
             
                    new(path).read
         
     | 
| 
         @@ -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
         
     | 
    
        data/lib/cucumber/step_match.rb
    CHANGED