1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Moved already resolved test

Couldn't figure out failed/fixed versions.
This commit is contained in:
Nobuyoshi Nakada 2020-04-27 01:50:23 +09:00
parent c180c58fc1
commit 6009790e40
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
2 changed files with 16 additions and 16 deletions

View file

@ -1,19 +1,3 @@
assert_equal 'A', %q{
class A
@@a = 'A'
def a=(x)
@@a = x
end
def a
@@a
end
end
B = A.dup
B.new.a = 'B'
A.new.a
}, '[ruby-core:17019]'
assert_equal 'ok', %q{ assert_equal 'ok', %q{
def m def m
lambda{ lambda{

View file

@ -2161,6 +2161,22 @@ class TestModule < Test::Unit::TestCase
assert_equal([:@@bar], m2.class_variables(false)) assert_equal([:@@bar], m2.class_variables(false))
end 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]' Bug6891 = '[ruby-core:47241]'
def test_extend_module_with_protected_method def test_extend_module_with_protected_method