Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Fix builds by pinning gem versions and updating cucumber #2950

Merged
merged 4 commits into from
Apr 1, 2022
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
14 changes: 12 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ if RUBY_VERSION < '1.9.3'
gem 'rake', '< 11.0.0' # rake 11 requires Ruby 1.9.3 or later
elsif RUBY_VERSION < '2.0.0'
gem 'rake', '< 12.0.0' # rake 12 requires Ruby 2.0.0 or later
elsif RUBY_VERSION < '2.2.0'
gem 'rake', '< 13.0.0' # rake 13 requires Ruby 2.2.0 or later
else
gem 'rake', '>= 12.3.3'
gem 'rake', '>= 13.0.0'
end

if ENV['DIFF_LCS_VERSION']
Expand Down Expand Up @@ -47,6 +49,8 @@ end

if RUBY_VERSION < '2.2.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/)
gem 'ffi', '< 1.10'
elsif RUBY_VERSION < '2.4.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/)
gem 'ffi', '< 1.15'
elsif RUBY_VERSION < '2.0'
gem 'ffi', '< 1.9.19' # ffi dropped Ruby 1.8 support in 1.9.19
elsif RUBY_VERSION < '2.3.0'
Expand All @@ -59,8 +63,10 @@ if RUBY_VERSION < '2.3.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|min
gem "childprocess", "< 1.0.0"
elsif RUBY_VERSION < '2.0.0'
gem "childprocess", "< 1.0.0"
elsif RUBY_VERSION < '2.3.0'
gem "childprocess", "< 3.0.0"
else
gem "childprocess", "> 1.0.0"
gem "childprocess", ">= 3.0.0"
end

platforms :jruby do
Expand Down Expand Up @@ -88,6 +94,10 @@ if RUBY_VERSION < '2.4.0'
gem 'minitest', '< 5.12.0'
end

if RUBY_VERSION < '2.0.0'
gem 'cucumber', "<= 1.3.22"
end

gem 'contracts', '< 0.16' if RUBY_VERSION < '1.9.0'

eval File.read('Gemfile-custom') if File.exist?('Gemfile-custom')
9 changes: 7 additions & 2 deletions cucumber.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<%

USE_TILDE_TAGS = !defined?(::RUBY_ENGINE_VERSION) || (::RUBY_ENGINE_VERSION < '2.0.0')
NOT_WIP_TAG = USE_TILDE_TAGS ? '~@wip' : '"not @wip"'
NOT_JRUBY_TAG = USE_TILDE_TAGS ? '~@no-jruby' : '"not @no-jruby"'

exclusions = []
exclusions << ' --tags ~@no-jruby' if RUBY_PLATFORM == 'java'
exclusions << " --tags #{NOT_JRUBY_TAG}" if RUBY_PLATFORM == 'java'
%>
default: --require features --strict --format progress --tags ~@wip<%= exclusions.join %> features
default: --require features --strict --format progress --tags <%= NOT_WIP_TAG %><%= exclusions.join %> features
wip: --require features --tags @wip:30 --wip features
2 changes: 1 addition & 1 deletion features/command_line/init.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: `--init` option
Scenario: Accept and use the recommended settings in `spec_helper` (which are initially commented out)
Given I have a brand new project with no files
And I have run `rspec --init`
When I accept the recommended settings by removing `=begin` and `=end` from `spec/spec_helper.rb`
When I accept the recommended settings by removing `=begin` and `=end` from `spec_helper.rb`
And I create "spec/addition_spec.rb" with the following content:
"""ruby
RSpec.describe "Addition" do
Expand Down
6 changes: 5 additions & 1 deletion features/metadata/described_class.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ Feature: described class
Scenario: Access the described class from the example
Given a file named "spec/example_spec.rb" with:
"""ruby
RSpec.describe Fixnum do
RSpec.describe Symbol do
it "is available as described_class" do
expect(described_class).to eq(Symbol)
end

describe 'inner' do
describe String do
it "is available as described_class" do
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/additional_cli_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
set_environment_variable('RUBYOPT', ENV['RUBYOPT'] + " -I#{gem_dir}/lib")
end

When "I accept the recommended settings by removing `=begin` and `=end` from `spec/spec_helper.rb`" do
When('I accept the recommended settings by removing `=begin` and `=end` from `spec_helper.rb`') do
cd('.') do
spec_helper = File.read("spec/spec_helper.rb")
expect(spec_helper).to include("=begin", "=end")
Expand Down
8 changes: 4 additions & 4 deletions features/support/diff_lcs_versions.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
require 'diff-lcs'

Around "@skip-when-diff-lcs-1.4" do |scenario, block|
if Diff::LCS::VERSION.to_f >= 1.4
warn "Skipping scenario #{scenario.title} on `diff-lcs` v#{Diff::LCS::VERSION.to_f}"
if Diff::LCS::VERSION >= '1.4'
skip_this_scenario "Skipping scenario #{scenario.name} on `diff-lcs` v#{Diff::LCS::VERSION}"
else
block.call
end
end

Around "@skip-when-diff-lcs-1.3" do |scenario, block|
if Diff::LCS::VERSION.to_f < 1.4
warn "Skipping scenario #{scenario.title} on `diff-lcs` v#{Diff::LCS::VERSION.to_f}"
if Diff::LCS::VERSION < '1.4'
skip_this_scenario "Skipping scenario #{scenario.name} on `diff-lcs` v#{Diff::LCS::VERSION}"
else
block.call
end
Expand Down
6 changes: 5 additions & 1 deletion features/support/jruby.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Around "@broken-on-jruby-9000" do |scenario, block|
require 'rspec/support/ruby_features'
block.call unless RSpec::Support::Ruby.jruby_9000?
if RSpec::Support::Ruby.jruby_9000?
skip_this_scenario "Skipping scenario #{scenario.name} not supported on JRuby 9000"
else
block.call
end
end
5 changes: 4 additions & 1 deletion features/support/require_expect_syntax_in_aruba_specs.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
if defined?(Cucumber)
require 'shellwords'
Before('~@allow-should-syntax', '~@with-clean-spec-opts') do
use_tilde_tags = !defined?(::RUBY_ENGINE_VERSION) || (::RUBY_ENGINE_VERSION < '2.0.0')
exclude_allow_should_syntax = use_tilde_tags ? '~@allow-should-syntax' : 'not @allow-should-syntax'
exclude_with_clean_spec_ops = use_tilde_tags ? '~@with-clean-spec-opts' : 'not @with-clean-spec-opts'
Before(exclude_allow_should_syntax, exclude_with_clean_spec_ops) do
set_environment_variable('SPEC_OPTS', "-r#{Shellwords.escape(__FILE__)}")
end

Expand Down
6 changes: 5 additions & 1 deletion features/support/rubinius.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
ENV['RBXOPT'] = "#{ENV["RBXOPT"]} -Xcompiler.no_rbc"

Around "@unsupported-on-rbx" do |scenario, block|
block.call unless defined?(Rubinius)
if defined?(Rubinius)
block.call
else
skip_this_scenario "Skipping scenario #{scenario.name} not supported on Rubinius"
end
end
2 changes: 1 addition & 1 deletion features/support/ruby_27_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
if RUBY_VERSION.to_f == 2.7
block.call
else
warn "Skipping scenario #{scenario.title} on Ruby v#{RUBY_VERSION}"
skip_this_scenario "Skipping scenario #{scenario.name} on Ruby v#{RUBY_VERSION}"
end
end
2 changes: 1 addition & 1 deletion rspec-core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency "rspec-support", "~> #{RSpec::Core::Version::STRING.split('.')[0..1].concat(['0']).join('.')}"
end

s.add_development_dependency "cucumber", "~> 1.3"
s.add_development_dependency "cucumber", ">= 1.3"
s.add_development_dependency "minitest", "~> 5.3"
s.add_development_dependency "aruba", "~> 0.14.9"

Expand Down