summaryrefslogtreecommitdiffhomepage
path: root/test/t
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-01-12 15:29:02 +0900
committerGitHub <[email protected]>2017-01-12 15:29:02 +0900
commitfb1dad82aae8c98949be7e5ad7440675c67265bb (patch)
treea53503ae7b868ca71399367f88c8c7407da1ba64 /test/t
parenta69d92e8197dc10b29387fd1e1272db13bdca0f5 (diff)
parent6be5160eb634e7b045cba83a38675cf14fa16593 (diff)
downloadmruby-fb1dad82aae8c98949be7e5ad7440675c67265bb.tar.gz
mruby-fb1dad82aae8c98949be7e5ad7440675c67265bb.zip
Merge pull request #3394 from clayton-shopify/really-fix-nme
Fix 36fc1f14 not checking in the right location
Diffstat (limited to 'test/t')
-rw-r--r--test/t/nomethoderror.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/t/nomethoderror.rb b/test/t/nomethoderror.rb
index 1c09bc20e..41a3ba14f 100644
--- a/test/t/nomethoderror.rb
+++ b/test/t/nomethoderror.rb
@@ -51,3 +51,21 @@ assert('Can still call super when BasicObject#method_missing is removed') do
end
end
end
+
+assert("NoMethodError#new does not return an exception") do
+ begin
+ class << NoMethodError
+ def new(*)
+ nil
+ end
+ end
+
+ assert_raise(TypeError) do
+ Object.q
+ end
+ ensure
+ class << NoMethodError
+ remove_method :new
+ end
+ end
+end