From 6183addf6a4b94db7fe5b9187ac66fa11c8d2825 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 12 Nov 2019 18:34:49 +0900 Subject: Add `Warning.[]` and `Warning.[]=` --- test/ruby/test_exception.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby/test_exception.rb') diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 05cc109b48..56cd19d0a2 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -1259,6 +1259,12 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| }; end + def test_warning_category + assert_raise(TypeError) {Warning[nil]} + assert_raise(ArgumentError) {Warning[:XXXX]} + assert_include([true, false], Warning[:deprecated]) + end + def test_undefined_backtrace assert_separately([], "#{<<-"begin;"}\n#{<<-"end;"}") begin; -- cgit v1.2.3