Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rspec-rails 4.0.0 claims to be compatible with ruby < 2.3 #2331

Closed
betesh opened this issue May 12, 2020 · 1 comment
Closed

rspec-rails 4.0.0 claims to be compatible with ruby < 2.3 #2331

betesh opened this issue May 12, 2020 · 1 comment

Comments

@betesh
Copy link
Contributor

betesh commented May 12, 2020

What Ruby, Rails and RSpec versions are you using?

Ruby version: 2.2.2 (I know you don't support it anymore. That's the whole point of this bug!)
Rails version: Any
RSpec version: 4.0.0

Observed behaviour

When running ruby 2.2.2, rspec-rails 4.0.0 gets installed with even though it uses the safe navigation operator, which was not introduced until ruby 2.3.0

Expected behaviour

When installing the bundle, bundler should raise a Bundler::VersionConflict because rspec-rails 4.0.0 depends on ruby >= 2.3.0.

Can you provide an example app?

~/rspec-rails-ruby-2.2.2 $ cat test.rb 
#! /usr/bin/env ruby

require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'

  gem 'rails'
  gem 'rspec-rails', '= 4.0.0'
end

require 'action_controller'
require 'action_view'
require 'rspec/rails'
~/rspec-rails-ruby-2.2.2 $ rvm 2.3.0 do ./test.rb   # This completes without errors
~/rspec-rails-ruby-2.2.2 $ rvm 2.2.2 do ./test.rb 
~/.rvm/gems/ruby-2.2.2/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:in `require': ~/.rvm/gems/ruby-2.2.2/gems/rspec-rails-4.0.0/lib/rspec/rails/example/mailer_example_group.rb:25: syntax error, unexpected '.' (SyntaxError)
          options&.each { |key, value| default_u...
                   ^
	from ~/.rvm/gems/ruby-2.2.2/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:in `block in require'
	from ~/.rvm/gems/ruby-2.2.2/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:257:in `load_dependency'
	from ~/.rvm/gems/ruby-2.2.2/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:in `require'
	from ~/.rvm/gems/ruby-2.2.2/gems/rspec-rails-4.0.0/lib/rspec/rails/example.rb:6:in `<top (required)>'
	from ~/.rvm/gems/ruby-2.2.2/gems/rspec-rails-4.0.0/lib/rspec/rails.rb:14:in `require'
	from ~/.rvm/gems/ruby-2.2.2/gems/rspec-rails-4.0.0/lib/rspec/rails.rb:14:in `<top (required)>'
	from ~/rspec-rails-ruby-2.2.2/test.rb:14:in `require'
	from ~/rspec-rails-ruby-2.2.2/test.rb:14:in `<main>'
@JonRowe
Copy link
Member

JonRowe commented May 12, 2020

Yes we're aware, this is a duplicate of #2319 the issue is that we hard support Rails 5 and 6, with all there requisite Ruby versions, but didn't update the version constraint with an effort to soft support Rails 4.2 for this transitionary version, but overlooked a hard minimum ruby version, its hard to fix due to ruybgems rules unforuntately.

@JonRowe JonRowe closed this as completed May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants