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

Add RSpec 4 support #89

Closed
wants to merge 1 commit into from
Closed

Add RSpec 4 support #89

wants to merge 1 commit into from

Conversation

pirj
Copy link

@pirj pirj commented Jul 11, 2022

No description provided.

@koic
Copy link
Collaborator

koic commented Apr 25, 2023

I opened #112 with test code and chores instead. So I'm sorry about this PR will be closed.

I have one question. Is there a planned release date for RSpec 4? I'm wondering whether RSpec 4 API is stable or not.

And here is off-topic, not related to test-queue. As for feedback on RSpec 4, I ran RuboCop with RSpec 4 and Ruby 3.2 and it failed unexpectedly.

$ cd path/to/rubocop

$ ruby -v
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-darwin19]

$ git diff
diff --git a/Gemfile b/Gemfile
index 48dd7b7ae..df861487b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -9,7 +9,11 @@ gem 'bump', require: false
 gem 'bundler', '>= 1.15.0', '< 3.0'
 gem 'memory_profiler', platform: :mri
 gem 'rake', '~> 13.0'
-gem 'rspec', '~> 3.7'
+gem 'rspec', github: 'rspec/rspec-metagem', branch: '4-0-dev'
+gem 'rspec-core', github: 'rspec/rspec-core', branch: '4-0-dev'
+gem 'rspec-expectations', github: 'rspec/rspec-expectations', branch: '4-0-dev'
+gem 'rspec-mocks', github: 'rspec/rspec-mocks', branch: '4-0-dev'
+gem 'rspec-support', github: 'rspec/rspec-support', branch: '4-0-dev'
 gem 'rubocop-performance', '~> 1.17.1'
 gem 'rubocop-rake', '~> 0.6.0'
 gem 'rubocop-rspec', '~> 2.20.0'

$ bundle exec rspec ./spec/rubocop/config_store_spec.rb:33
Run options: include {:locations=>{"./spec/rubocop/config_store_spec.rb"=>[33]}}

Randomized with seed 3117
F

Failures:

  1) RuboCop::ConfigStore.for when no config specified in command line gets config path and config from cache if available
     Failure/Error:
       expect(RuboCop::ConfigLoader)
         .to receive(:configuration_from_file)
         .with('dir/.rubocop.yml', check: true).once

       #<RuboCop::ConfigLoader (class)> received :configuration_from_file with unexpected arguments
         expected: ("dir/.rubocop.yml", {:check=>true}) (keyword arguments)
              got: ("dir/.rubocop.yml", {:check=>true}) (options hash)
       Diff:

     # ./spec/rubocop/config_store_spec.rb:33:in `block (4 levels) in <top (required)>'

Finished in 0.0317 seconds (files took 1.4 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/rubocop/config_store_spec.rb:29 # RuboCop::ConfigStore.for when no config specified in command line gets config path and config from cache if available

Randomized with seed 3117

This test passes in Ruby 3.1. It's probably related to the strict behavior of ruby2_keywords in Ruby 3.2. However, the cause has not been identified.

@koic koic closed this Apr 25, 2023
@pirj pirj deleted the add-rspec-4-support branch April 25, 2023 20:39
@pirj
Copy link
Author

pirj commented Apr 25, 2023

Is there a planned release date for RSpec 4?

There is a plan, but there are other things the team is spending their time, too. So, no, no planned release date.

I'm wondering whether RSpec 4 API is stable or not.

There are no further changes on the roadmap. Pretty stable.

off-topic, not related to test-queue. As for feedback on RSpec 4, I ran RuboCop with RSpec 4 and Ruby 3.2 and it failed unexpectedly.

Most probably, some of Ruby 3.2 kwargs fixes that were merged to 3.x-maintenance were not forward-ported into 4-0-development.
Back then, when I've added that job, there was no Ruby 3.2 yet. And there's a hack not to run test-queue as you may see. So, when your PR is merged, it's time to change to 3.2 and bring test-queue back.

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

Successfully merging this pull request may close these issues.

2 participants