From dd52b881017ae2c39d8afeed4f0560eff19031da Mon Sep 17 00:00:00 2001 From: Christopher Aue Date: Tue, 18 Jul 2017 20:47:05 +0200 Subject: implemented Module#singleton_class? --- mrbgems/mruby-class-ext/test/module.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mrbgems/mruby-class-ext/test/module.rb') diff --git a/mrbgems/mruby-class-ext/test/module.rb b/mrbgems/mruby-class-ext/test/module.rb index f721ad0c6..64b755278 100644 --- a/mrbgems/mruby-class-ext/test/module.rb +++ b/mrbgems/mruby-class-ext/test/module.rb @@ -8,3 +8,13 @@ assert 'Module#name' do assert_equal 'Fixnum', Fixnum.name assert_equal 'A::B', A::B.name end + +assert 'Module#singleton_class?' do + mod = Module.new + cls = Class.new + scl = cls.singleton_class + + assert_false mod.singleton_class? + assert_false cls.singleton_class? + assert_true scl.singleton_class? +end -- cgit v1.2.3