Skip to content

Suppress unnecessary deprecation warning for Ruby v3.1. #7

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

Conversation

kyto64
Copy link
Contributor

@kyto64 kyto64 commented Sep 26, 2023

I use Ruby v3.1 in RoR application.

A deprecation warning is output for each test run, but I assume that this warning has already been fixed and is unnecessary.

So, I have changed to use the new logic from Ruby v3.1.

root@b33a198a1459:/app# RAILS_ENV=test bundle e rspec spec/model/sample.rb                                      
/usr/local/bundle/gems/rspec-parameterized-table_syntax-1.0.0/lib/rspec/parameterized/table_syntax.rb:38: warning: Refinement#include is deprecated and will be removed in Ruby 3.2                                                                                                       
/usr/local/bundle/gems/rspec-parameterized-table_syntax-1.0.0/lib/rspec/parameterized/table_syntax.rb:42: warning: Refinement#include is deprecated and will be removed in Ruby 3.2                                                                                                       
/usr/local/bundle/gems/rspec-parameterized-table_syntax-1.0.0/lib/rspec/parameterized/table_syntax.rb:46: warning: Refinement#include is deprecated and will be removed in Ruby 3.2                                                                                                       
/usr/local/bundle/gems/rspec-parameterized-table_syntax-1.0.0/lib/rspec/parameterized/table_syntax.rb:50: warning: Refinement#include is deprecated and will be removed in Ruby 3.2                                                                                                       
/usr/local/bundle/gems/rspec-parameterized-table_syntax-1.0.0/lib/rspec/parameterized/table_syntax.rb:54: warning: Refinement#include is deprecated and will be removed in Ruby 3.2
/usr/local/bundle/gems/rspec-parameterized-table_syntax-1.0.0/lib/rspec/parameterized/table_syntax.rb:58: warning: Refinement#include is deprecated and will be removed in Ruby 3.2
...

ref: https://bugs.ruby-lang.org/issues/17429

@sue445 sue445 self-assigned this Sep 26, 2023
@sue445
Copy link
Contributor

sue445 commented Sep 26, 2023

@Kytozz thx!

CI is not working, but I checked the operation at hand and confirmed that there is no problem

master

$ ruby --version
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [arm64-darwin22]

$ RUBYOPT=-W:deprecated bundle exec rspec
/Users/sue445/workspace/github.com/rspec-parameterized/rspec-parameterized-table_syntax/lib/rspec/parameterized/table_syntax.rb:38: warning: Refinement#include is deprecated and will be removed in Ruby 3.2
/Users/sue445/workspace/github.com/rspec-parameterized/rspec-parameterized-table_syntax/lib/rspec/parameterized/table_syntax.rb:42: warning: Refinement#include is deprecated and will be removed in Ruby 3.2
/Users/sue445/workspace/github.com/rspec-parameterized/rspec-parameterized-table_syntax/lib/rspec/parameterized/table_syntax.rb:46: warning: Refinement#include is deprecated and will be removed in Ruby 3.2
/Users/sue445/workspace/github.com/rspec-parameterized/rspec-parameterized-table_syntax/lib/rspec/parameterized/table_syntax.rb:50: warning: Refinement#include is deprecated and will be removed in Ruby 3.2
/Users/sue445/workspace/github.com/rspec-parameterized/rspec-parameterized-table_syntax/lib/rspec/parameterized/table_syntax.rb:54: warning: Refinement#include is deprecated and will be removed in Ruby 3.2
/Users/sue445/workspace/github.com/rspec-parameterized/rspec-parameterized-table_syntax/lib/rspec/parameterized/table_syntax.rb:58: warning: Refinement#include is deprecated and will be removed in Ruby 3.2

RSpec::Parameterized::TableSyntax
  table separated with pipe (using TableSyntax)
    a: 1, b: 2, answer: 3
      a plus b is answer

your patch

$ RUBYOPT=-W:deprecated bundle exec rspec

RSpec::Parameterized::TableSyntax
  table separated with pipe (using TableSyntax)
    a: 1, b: 2, answer: 3
      a plus b is answer

@sue445 sue445 merged commit 6427b88 into rspec-parameterized:main Sep 26, 2023
@sue445
Copy link
Contributor

sue445 commented Sep 26, 2023

@Kytozz I published as v1.0.1 🚀

https://github.com/rspec-parameterized/rspec-parameterized-table_syntax/blob/main/CHANGELOG.md#101---2023-09-26

@kyto64 kyto64 deleted the suppress-unnecessary-deprecation-warning branch November 4, 2023 15:05
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