Add spec for `Warning[:performance]`

[Feature #19538]
This commit is contained in:
Jean Boussier 2023-04-14 11:26:09 +02:00 коммит произвёл Jean Boussier
Родитель a0d1069e03
Коммит f3979aec76
2 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -7,6 +7,12 @@ Note that each entry is kept to a minimum, see links for details.
## Language changes
## Command line options
* A new `performance` warning category was introduced.
They are not displayed by default even in verbose mode.
Turn them on with `-W:performance` or `Warning[:performance] = true`. [[Feature #19538]]
## Core classes updates
Note: We're only listing outstanding class updates.
@ -79,5 +85,7 @@ changelog for details of the default gems or bundled gems.
## JIT
[Bug #19150]: https://bugs.ruby-lang.org/issues/19150
[Feature #18498]: https://bugs.ruby-lang.org/issues/18498
[Feature #19314]: https://bugs.ruby-lang.org/issues/19314
[Feature #19347]: https://bugs.ruby-lang.org/issues/19347
[Feature #19538]: https://bugs.ruby-lang.org/issues/19538

Просмотреть файл

@ -8,6 +8,13 @@ describe "Warning.[]" do
end
end
ruby_version_is '3.3' do
it "returns default values for :performance category" do
ruby_exe('p Warning[:performance]').chomp.should == "false"
ruby_exe('p Warning[:performance]', options: "-w").chomp.should == "false"
end
end
it "raises for unknown category" do
-> { Warning[:noop] }.should raise_error(ArgumentError, /unknown category: noop/)
end