mirror of
https://github.com/ruby/ruby.git
synced 2026-01-29 13:34:17 +00:00
Skip Warning.[] spec if mspec is passing warning options
This commit is contained in:
parent
41f8ae1ffd
commit
febad5cbda
@ -1,9 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# This is turned off because when we run with --parser=prism we explicitly turn
|
||||
# off experimental warnings to make sure the output is consistent.
|
||||
MSpec.register(:exclude, "Warning.[] returns default values for categories :deprecated and :experimental")
|
||||
|
||||
## Language
|
||||
MSpec.register(:exclude, "Hash literal raises a SyntaxError at parse time when Symbol key with invalid bytes")
|
||||
MSpec.register(:exclude, "Hash literal raises a SyntaxError at parse time when Symbol key with invalid bytes and 'key: value' syntax used")
|
||||
|
||||
@ -2,6 +2,10 @@ require_relative '../../spec_helper'
|
||||
|
||||
describe "Warning.[]" do
|
||||
it "returns default values for categories :deprecated and :experimental" do
|
||||
# If any warning options were set on the Ruby that will be executed, then
|
||||
# it's possible this test will fail. In this case we will skip this test.
|
||||
skip if ruby_exe.any? { |opt| opt.start_with?("-W") }
|
||||
|
||||
ruby_exe('p [Warning[:deprecated], Warning[:experimental]]').chomp.should == "[false, true]"
|
||||
ruby_exe('p [Warning[:deprecated], Warning[:experimental]]', options: "-w").chomp.should == "[true, true]"
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user