Warning module is available in core since 2.4. See https://ruby-doc.org/core-2.4.0/Warning.html
This is used for instance in ROM https://github.com/rom-rb/rom/blob/e444df079a4d903205aea4a60962d0c5ef0447af/changeset/spec/spec_helper.rb#L65
So their specs fail there due to that.
To reproduce
Error:
NameError: uninitialized constant Warning
from (irb):1:in `const_missing'
from (irb):1
from ~/.rubies/truffleruby-1.0.0-rc9/bin/irb:29:in `<main>'
We do have specs for this, so it should be easy enough to implement. It may be tricker to route all our existing warnings through it, though, and I don't think that bit is specified.
@chrisseaton actually, it seems something is here https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/utils/warnings.rb#L31 @eregon will know more though
No that doesn't cover the behaviour I'm referring to - but it's ok I found it is tested a bit more in MRI tests.
I have a branch with this mostly fixed on, and some additional specs to cover behaviour that wasn't mentioned.
Just a note,
warning_api_available = defined?(Warning)
Would be a lot better to detect if it's available.
But of course it's good to implement it as well.
This is fixed in 1d08927dd34081a478b79564be7b5aab009ac433 and will be in the next release.
Most helpful comment
No that doesn't cover the behaviour I'm referring to - but it's ok I found it is tested a bit more in MRI tests.
I have a branch with this mostly fixed on, and some additional specs to cover behaviour that wasn't mentioned.