diff options
author | Kevin Newton <kddnewton@gmail.com> | 2024-05-01 14:09:24 -0400 |
---|---|---|
committer | Kevin Newton <kddnewton@gmail.com> | 2024-05-01 14:49:45 -0400 |
commit | febad5cbda83da6cadd682b52ca533751ff523db (patch) | |
tree | 1460c48ead63ccffa4769ee4f90cf2d1150d5fc1 /spec/ruby | |
parent | 41f8ae1ffdca349d0301b480c690e83a1dd1e723 (diff) | |
download | ruby-febad5cbda83da6cadd682b52ca533751ff523db.tar.gz |
Skip Warning.[] spec if mspec is passing warning options
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/core/warning/element_reference_spec.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/ruby/core/warning/element_reference_spec.rb b/spec/ruby/core/warning/element_reference_spec.rb index 8cb4018c20..c0ed37ef13 100644 --- a/spec/ruby/core/warning/element_reference_spec.rb +++ b/spec/ruby/core/warning/element_reference_spec.rb @@ -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 |