summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-24 14:06:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-24 14:06:31 +0000
commitd3326ddf1113a0b0788658e5ef6131f2722ab3c4 (patch)
treedfaf4aee22a13609637b194305a8d7820048598b /test
parent0e3822c1e2e81baa96793e881cbbdfc2db7aba3a (diff)
* vm_insnhelper.c (vm_get_ev_const): should not autoload in
defined? mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_defined.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_defined.rb b/test/ruby/test_defined.rb
index e1d685275d..6a1f702648 100644
--- a/test/ruby/test_defined.rb
+++ b/test/ruby/test_defined.rb
@@ -103,4 +103,15 @@ class TestDefined < Test::Unit::TestCase
end
assert_equal("constant", klass.new.a?, bug)
end
+
+ def test_autoloaded_noload
+ klass = Class.new do
+ autoload(:A, "a")
+ def a?
+ defined?(A)
+ end
+ end
+ x = klass.new
+ assert_equal("constant", x.a?)
+ end
end