summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--error.c2
-rw-r--r--test/ruby/test_pattern_matching.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/error.c b/error.c
index e74b2144ca..5e3e4e358b 100644
--- a/error.c
+++ b/error.c
@@ -2804,7 +2804,7 @@ Init_Exception(void)
rb_eNoMemError = rb_define_class("NoMemoryError", rb_eException);
rb_eEncodingError = rb_define_class("EncodingError", rb_eStandardError);
rb_eEncCompatError = rb_define_class_under(rb_cEncoding, "CompatibilityError", rb_eEncodingError);
- rb_eNoMatchingPatternError = rb_define_class("NoMatchingPatternError", rb_eRuntimeError);
+ rb_eNoMatchingPatternError = rb_define_class("NoMatchingPatternError", rb_eStandardError);
syserr_tbl = st_init_numtable();
rb_eSystemCallError = rb_define_class("SystemCallError", rb_eStandardError);
diff --git a/test/ruby/test_pattern_matching.rb b/test/ruby/test_pattern_matching.rb
index e553789756..243a4cd2bd 100644
--- a/test/ruby/test_pattern_matching.rb
+++ b/test/ruby/test_pattern_matching.rb
@@ -1162,6 +1162,10 @@ END
end
end
+ def test_nomatchingpatternerror
+ assert_equal(StandardError, NoMatchingPatternError.superclass)
+ end
+
def test_invalid_syntax
assert_syntax_error(%q{
case 0