Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.bundle
nbproject
coverage
pkg
doc
Expand All @@ -8,20 +7,12 @@ tmp
*.log
*.pid
.eprj
.tmtags
*~
.DS_Store
*.swp
*.swo
target
*.tmproj
.#*
.idea
.vscode
*.pyc
*.rbc
rerun.txt
._*
.rvmrc
.sass-cache
doc/
Expand All @@ -33,5 +24,4 @@ Gemfile.local
Gemfile.local.lock
.envrc
Gemfile.lock
bin/json-formatter
acceptance/*
acceptance/*
43 changes: 0 additions & 43 deletions Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ Later in this document, bundler is considered being used so all commands are usi

### Supported platforms

- Ruby 4.0
- Ruby 3.4
- Ruby 3.3
- Ruby 3.2
- Ruby 3.1
- TruffleRuby 24.0.0+
- JRuby 9.4+ (with [some limitations](https://github.com/cucumber/cucumber-ruby/blob/main/docs/jruby-limitations.md))
- JRuby 10.0+ (with [some limitations](https://github.com/cucumber/cucumber-ruby/blob/main/docs/jruby-limitations.md))

### Ruby on Rails

Expand Down
2 changes: 1 addition & 1 deletion cucumber.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Gem::Specification.new do |s|
s.add_dependency 'cucumber-ci-environment', '> 9', '< 12'
s.add_dependency 'cucumber-core', '>= 16.2.0', '< 17'
s.add_dependency 'cucumber-cucumber-expressions', '> 17', '< 20'
s.add_dependency 'cucumber-html-formatter', '> 21', '< 23'
s.add_dependency 'cucumber-html-formatter', '> 21', '< 24'
s.add_dependency 'diff-lcs', '~> 1.5'
s.add_dependency 'logger', '~> 1.6'
s.add_dependency 'mini_mime', '~> 1.1'
Expand Down
6 changes: 0 additions & 6 deletions features/docs/cli/ordering.feature
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,6 @@ Feature: Ordering
Randomized with seed 41544
"""

@force_legacy_loader
Scenario: Rerun scenarios randomized
When I run `cucumber --order random --format summary`
And I rerun the previous command with the same seed
Then the output of both commands should be the same

@global_state
Scenario: Run scenarios randomized with some skipped
When I run `cucumber --tags "not @skipme" --order random:41544 -q`
Expand Down
7 changes: 0 additions & 7 deletions features/lib/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@
ENV['CUCUMBER_PUBLISH_TOKEN'] = original_publish_token
end

Around('@force_legacy_loader') do |_, block|
original_loader = Cucumber.use_legacy_autoloader
Cucumber.use_legacy_autoloader = true
block.call
Cucumber.use_legacy_autoloader = original_loader
end

Before('@global_state') do
# Ok, this one is tricky but kinda make sense.
# So, we need to share state between some sub-scenarios (the ones executed by
Expand Down
14 changes: 1 addition & 13 deletions lib/cucumber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
module Cucumber
class << self
attr_accessor :wants_to_quit
attr_reader :use_legacy_autoloader

def deprecate(message, method, remove_after_version)
Kernel.warn(
Expand All @@ -24,22 +23,11 @@ def deprecate(message, method, remove_after_version)
def logger
return @log if @log

@log = Logger.new($stdout)
@log.level = Logger::INFO
@log
@log = Logger.new($stdout).tap { it.level = Logger::INFO }
end

def logger=(logger)
@log = logger
end

def use_legacy_autoloader=(value)
Cucumber.deprecate(
'This will be phased out of cucumber and should not be used. It is only there to support legacy systems',
'.use_legacy_autoloader',
'11.0.0'
)
@use_legacy_autoloader = value
end
end
end
2 changes: 1 addition & 1 deletion lib/cucumber/formatter/usage.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# frozen_string_literal: true

require 'cucumber/formatter/progress'
require 'cucumber/step_definition_light'
require 'cucumber/formatter/console'

module Cucumber
module Formatter
class Usage < Progress
include Console

class StepDefKey
attr_accessor :mean_duration, :status
attr_reader :regexp_source, :location
Expand Down
8 changes: 1 addition & 7 deletions lib/cucumber/glue/registry_and_more.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
require 'cucumber/gherkin/i18n'
require 'multi_test'
require 'cucumber/step_match'
require 'cucumber/step_definition_light'
require 'cucumber/events/step_definition_registered'

module Cucumber
Expand Down Expand Up @@ -128,12 +127,7 @@ def load_code_file(code_file)
return unless File.extname(code_file) == '.rb'

# This will cause self.add_step_definition, self.add_hook, and self.define_parameter_type to be called from Glue::Dsl

if Cucumber.use_legacy_autoloader
load File.expand_path(code_file)
else
require File.expand_path(code_file)
end
require File.expand_path(code_file)
end

def begin_scenario(test_case)
Expand Down
11 changes: 0 additions & 11 deletions lib/cucumber/multiline_argument/data_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,6 @@ def verify_table_width(width)
raise %(The table must have exactly #{width} columns) unless raw[0].size == width
end

# TODO: remove the below function if it's not actually being used.
# Nothing else in this repo calls it.
def text?(text)
Cucumber.deprecate(
'This method is no longer supported for checking text',
'#text?',
'11.0.0'
)
raw.flatten.compact.detect { |cell_value| cell_value.index(text) }
end

def cells_rows
@rows ||= cell_matrix.map do |cell_row|
Cells.new(self, cell_row)
Expand Down
29 changes: 0 additions & 29 deletions lib/cucumber/step_definition_light.rb

This file was deleted.

46 changes: 0 additions & 46 deletions spec/cucumber/glue/registry_and_more_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def self.value; 2; end
end
STRING
end

let(:value3) do
<<~STRING
class Foo
Expand Down Expand Up @@ -73,51 +72,6 @@ def a_file_called(name)
expect(Foo.value).not_to eq(3)
end
end

context 'when using `use_legacy_autoloader`' do
before(:each) { allow(Cucumber).to receive(:use_legacy_autoloader).and_return(true) }

it 're-loads the file when called multiple times' do
a_file_called('tmp2.rb') { value1 }
registry.load_code_file('tmp2.rb')
a_file_called('tmp2.rb') { value2 }
registry.load_code_file('tmp2.rb')

expect(Foo.value).to eq(2)
end

it 'only loads ruby files' do
a_file_called('tmp2.rb') { value1 }
a_file_called('docs2.md') { value3 }
registry.load_code_file('tmp2.rb')
registry.load_code_file('docs2.md')

expect(Foo.value).not_to eq(3)
end
end

context 'when explicitly NOT using `use_legacy_autoloader`' do
before(:each) { allow(Cucumber).to receive(:use_legacy_autoloader).and_return(false) }
after(:each) { FileUtils.rm_rf('tmp3.rb') }

it 'does not re-load the file when called multiple times' do
a_file_called('tmp3.rb') { value1 }
registry.load_code_file('tmp3.rb')
a_file_called('tmp3.rb') { value2 }
registry.load_code_file('tmp3.rb')

expect(Foo.value).to eq(1)
end

it 'only loads ruby files' do
a_file_called('tmp3.rb') { value1 }
a_file_called('docs3.md') { value3 }
registry.load_code_file('tmp3.rb')
registry.load_code_file('docs3.md')

expect(Foo.value).not_to eq(3)
end
end
end

describe 'Handling the World' do
Expand Down
37 changes: 37 additions & 0 deletions upgrading_notes/11.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Upgrading to 11.0.0

## CCK conformance

CCK conformance has been bumped to v22. This has seen a lot of rewrites specifically around formatters
- The `message` default formatters (Which all other formatters are being built on, has been refactored heavily to output more information
- The `rerun` formatter is now completely rebuilt using messages - the behaviour should be identical

## Removed previously deprecated items that were deprecated in v10

### #text?

The `#text?` method for checking differences in multi-line heredocs or texts has been removed

Should you wish to check multi-line text fragments for differences and issues, there are a host of better-suited
libraries that handle this better, and this should be handled outside the remit of cucumber

### Cucumber.use_legacy_autoloader configuration setting

This setting has now been removed. All files will only ever autoload once

### StepDefinitionLight

This class and its associated actions has been removed. It served little to no purpose other than in
one of the legacy formatters that we aim to remove and port to messages and some associated "shim" languages
which aren't in the purview of the team anymore

## Newly deprecated items

### Strict configuration

For a while cucumber has been heavily divergent in terms of how it handles "strict" mode - In some places it was a configuration setting,
in others it was a command line flag, and in others it was just a concept that was handled differently across different formatters

Going forward in v11, we will explicitly advise against using strict mode and instead encourage users to use the intended
default behaviours for scenarios that involve undefined steps, pending steps, or failed steps. This is in line with the intended design of cucumber and will help to
encourage better practices and more consistent behaviour across different formatters and runners
Loading