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

Commit 1a17887

Browse files
authored
Merge pull request #2950 from rspec/update-ffi-ruby-23-windows
Fix builds by pinning gem versions (and wip try to update cucumber)
2 parents ca39ab1 + bf49c78 commit 1a17887

File tree

11 files changed

+46
-16
lines changed

11 files changed

+46
-16
lines changed

Gemfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ if RUBY_VERSION < '1.9.3'
1616
gem 'rake', '< 11.0.0' # rake 11 requires Ruby 1.9.3 or later
1717
elsif RUBY_VERSION < '2.0.0'
1818
gem 'rake', '< 12.0.0' # rake 12 requires Ruby 2.0.0 or later
19+
elsif RUBY_VERSION < '2.2.0'
20+
gem 'rake', '< 13.0.0' # rake 13 requires Ruby 2.2.0 or later
1921
else
20-
gem 'rake', '>= 12.3.3'
22+
gem 'rake', '>= 13.0.0'
2123
end
2224

2325
if ENV['DIFF_LCS_VERSION']
@@ -47,6 +49,8 @@ end
4749

4850
if RUBY_VERSION < '2.2.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/)
4951
gem 'ffi', '< 1.10'
52+
elsif RUBY_VERSION < '2.4.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/)
53+
gem 'ffi', '< 1.15'
5054
elsif RUBY_VERSION < '2.0'
5155
gem 'ffi', '< 1.9.19' # ffi dropped Ruby 1.8 support in 1.9.19
5256
elsif RUBY_VERSION < '2.3.0'
@@ -59,8 +63,10 @@ if RUBY_VERSION < '2.3.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|min
5963
gem "childprocess", "< 1.0.0"
6064
elsif RUBY_VERSION < '2.0.0'
6165
gem "childprocess", "< 1.0.0"
66+
elsif RUBY_VERSION < '2.3.0'
67+
gem "childprocess", "< 3.0.0"
6268
else
63-
gem "childprocess", "> 1.0.0"
69+
gem "childprocess", ">= 3.0.0"
6470
end
6571

6672
platforms :jruby do
@@ -88,6 +94,10 @@ if RUBY_VERSION < '2.4.0'
8894
gem 'minitest', '< 5.12.0'
8995
end
9096

97+
if RUBY_VERSION < '2.0.0'
98+
gem 'cucumber', "<= 1.3.22"
99+
end
100+
91101
gem 'contracts', '< 0.16' if RUBY_VERSION < '1.9.0'
92102

93103
eval File.read('Gemfile-custom') if File.exist?('Gemfile-custom')

cucumber.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<%
2+
3+
USE_TILDE_TAGS = !defined?(::RUBY_ENGINE_VERSION) || (::RUBY_ENGINE_VERSION < '2.0.0')
4+
NOT_WIP_TAG = USE_TILDE_TAGS ? '~@wip' : '"not @wip"'
5+
NOT_JRUBY_TAG = USE_TILDE_TAGS ? '~@no-jruby' : '"not @no-jruby"'
6+
27
exclusions = []
3-
exclusions << ' --tags ~@no-jruby' if RUBY_PLATFORM == 'java'
8+
exclusions << " --tags #{NOT_JRUBY_TAG}" if RUBY_PLATFORM == 'java'
49
%>
5-
default: --require features --strict --format progress --tags ~@wip<%= exclusions.join %> features
10+
default: --require features --strict --format progress --tags <%= NOT_WIP_TAG %><%= exclusions.join %> features
611
wip: --require features --tags @wip:30 --wip features

features/command_line/init.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Feature: `--init` option
2525
Scenario: Accept and use the recommended settings in `spec_helper` (which are initially commented out)
2626
Given I have a brand new project with no files
2727
And I have run `rspec --init`
28-
When I accept the recommended settings by removing `=begin` and `=end` from `spec/spec_helper.rb`
28+
When I accept the recommended settings by removing `=begin` and `=end` from `spec_helper.rb`
2929
And I create "spec/addition_spec.rb" with the following content:
3030
"""ruby
3131
RSpec.describe "Addition" do

features/metadata/described_class.feature

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ Feature: described class
66
Scenario: Access the described class from the example
77
Given a file named "spec/example_spec.rb" with:
88
"""ruby
9-
RSpec.describe Fixnum do
9+
RSpec.describe Symbol do
10+
it "is available as described_class" do
11+
expect(described_class).to eq(Symbol)
12+
end
13+
1014
describe 'inner' do
1115
describe String do
1216
it "is available as described_class" do

features/step_definitions/additional_cli_steps.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
set_environment_variable('RUBYOPT', ENV['RUBYOPT'] + " -I#{gem_dir}/lib")
115115
end
116116

117-
When "I accept the recommended settings by removing `=begin` and `=end` from `spec/spec_helper.rb`" do
117+
When('I accept the recommended settings by removing `=begin` and `=end` from `spec_helper.rb`') do
118118
cd('.') do
119119
spec_helper = File.read("spec/spec_helper.rb")
120120
expect(spec_helper).to include("=begin", "=end")

features/support/diff_lcs_versions.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
require 'diff-lcs'
22

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

1111
Around "@skip-when-diff-lcs-1.3" do |scenario, block|
12-
if Diff::LCS::VERSION.to_f < 1.4
13-
warn "Skipping scenario #{scenario.title} on `diff-lcs` v#{Diff::LCS::VERSION.to_f}"
12+
if Diff::LCS::VERSION < '1.4'
13+
skip_this_scenario "Skipping scenario #{scenario.name} on `diff-lcs` v#{Diff::LCS::VERSION}"
1414
else
1515
block.call
1616
end

features/support/jruby.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
Around "@broken-on-jruby-9000" do |scenario, block|
22
require 'rspec/support/ruby_features'
3-
block.call unless RSpec::Support::Ruby.jruby_9000?
3+
if RSpec::Support::Ruby.jruby_9000?
4+
skip_this_scenario "Skipping scenario #{scenario.name} not supported on JRuby 9000"
5+
else
6+
block.call
7+
end
48
end

features/support/require_expect_syntax_in_aruba_specs.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
if defined?(Cucumber)
22
require 'shellwords'
3-
Before('~@allow-should-syntax', '~@with-clean-spec-opts') do
3+
use_tilde_tags = !defined?(::RUBY_ENGINE_VERSION) || (::RUBY_ENGINE_VERSION < '2.0.0')
4+
exclude_allow_should_syntax = use_tilde_tags ? '~@allow-should-syntax' : 'not @allow-should-syntax'
5+
exclude_with_clean_spec_ops = use_tilde_tags ? '~@with-clean-spec-opts' : 'not @with-clean-spec-opts'
6+
Before(exclude_allow_should_syntax, exclude_with_clean_spec_ops) do
47
set_environment_variable('SPEC_OPTS', "-r#{Shellwords.escape(__FILE__)}")
58
end
69

features/support/rubinius.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
ENV['RBXOPT'] = "#{ENV["RBXOPT"]} -Xcompiler.no_rbc"
33

44
Around "@unsupported-on-rbx" do |scenario, block|
5-
block.call unless defined?(Rubinius)
5+
if defined?(Rubinius)
6+
block.call
7+
else
8+
skip_this_scenario "Skipping scenario #{scenario.name} not supported on Rubinius"
9+
end
610
end

features/support/ruby_27_support.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
if RUBY_VERSION.to_f == 2.7
33
block.call
44
else
5-
warn "Skipping scenario #{scenario.title} on Ruby v#{RUBY_VERSION}"
5+
skip_this_scenario "Skipping scenario #{scenario.name} on Ruby v#{RUBY_VERSION}"
66
end
77
end

rspec-core.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Gem::Specification.new do |s|
4545
s.add_runtime_dependency "rspec-support", "~> #{RSpec::Core::Version::STRING.split('.')[0..1].concat(['0']).join('.')}"
4646
end
4747

48-
s.add_development_dependency "cucumber", "~> 1.3"
48+
s.add_development_dependency "cucumber", ">= 1.3"
4949
s.add_development_dependency "minitest", "~> 5.3"
5050
s.add_development_dependency "aruba", "~> 0.14.9"
5151

0 commit comments

Comments
 (0)