summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
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