summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_defined.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_defined.rb b/test/ruby/test_defined.rb
index 6a1f702648..de64ac46f8 100644
--- a/test/ruby/test_defined.rb
+++ b/test/ruby/test_defined.rb
@@ -105,6 +105,8 @@ class TestDefined < Test::Unit::TestCase
end
def test_autoloaded_noload
+ loaded = $".dup
+ $".clear
klass = Class.new do
autoload(:A, "a")
def a?
@@ -113,5 +115,8 @@ class TestDefined < Test::Unit::TestCase
end
x = klass.new
assert_equal("constant", x.a?)
+ assert_equal([], $")
+ ensure
+ $".replace(loaded)
end
end