From 01a21085f6348b1f1b070f2c64a6ed71b6d5afce Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 3 Jun 2021 16:45:12 +0900 Subject: add a few regressions test from #2313 The code was contributed from Carson McDonald (@carsonmcdonald) --- test/t/class.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/t/class.rb b/test/t/class.rb index e2839111c..1b4b84890 100644 --- a/test/t/class.rb +++ b/test/t/class.rb @@ -375,6 +375,20 @@ assert('clone Class') do assert_true(Foo.clone.new.func) end +assert('class definition in singleton class') do + class AClassS + class << self + class BClass + end + + def iclass + BClass + end + end + end + assert_equal(Class, AClassS.iclass.class) +end + assert('class variable and class << self style class method') do class ClassVariableTest @@class_variable = "value" -- cgit v1.2.3