diff options
-rw-r--r-- | test/ruby/test_thread.rb | 4 | ||||
-rw-r--r-- | thread.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index 3695f6e4ea..591292962d 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -557,7 +557,9 @@ class TestThread < Test::Unit::TestCase assert_equal(3, t.fetch("qux") {x = 3}) assert_equal(3, x) - assert_raise(KeyError) {t.fetch(:qux)} + e = assert_raise(KeyError) {t.fetch(:qux)} + assert_equal(:qux, e.key) + assert_equal(t, e.receiver) ensure t.kill if t end @@ -3168,7 +3168,7 @@ rb_thread_fetch(int argc, VALUE *argv, VALUE self) return rb_yield(key); } else if (argc == 1) { - rb_raise(rb_eKeyError, "key not found: %"PRIsVALUE, key); + rb_key_err_raise(rb_sprintf("key not found: %+"PRIsVALUE, key), self, key); } else { return argv[1]; |