ruby-changes:60920
From: Nobuyoshi <ko1@a...>
Date: Mon, 27 Apr 2020 10:39:57 +0900 (JST)
Subject: [ruby-changes:60920] 6009790e40 (master): Moved already resolved test
https://git.ruby-lang.org/ruby.git/commit/?id=6009790e40 From 6009790e4072c8c6736773cf22addb20ad5aac02 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Mon, 27 Apr 2020 01:50:23 +0900 Subject: Moved already resolved test Couldn't figure out failed/fixed versions. diff --git a/bootstraptest/pending.rb b/bootstraptest/pending.rb index 66aab1e..2c4b85a 100644 --- a/bootstraptest/pending.rb +++ b/bootstraptest/pending.rb @@ -1,19 +1,3 @@ https://github.com/ruby/ruby/blob/trunk/bootstraptest/pending.rb#L1 -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{ def m lambda{ diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index e5586ed..e3cd627 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -2161,6 +2161,22 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L2161 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/