summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_module.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index e5586edc6d..e3cd62713f 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -2161,6 +2161,22 @@ class TestModule < Test::Unit::TestCase
assert_equal([:@@bar], m2.class_variables(false))
end
+ def test_class_variable_in_dup_class
+ a = Class.new do
+ @@a = 'A'
+ def a=(x)
+ @@a = x
+ end
+ def a
+ @@a
+ end
+ end
+
+ b = a.dup
+ b.new.a = 'B'
+ assert_equal 'A', a.new.a, '[ruby-core:17019]'
+ end
+
Bug6891 = '[ruby-core:47241]'
def test_extend_module_with_protected_method