diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-08 14:01:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-08 14:01:23 +0000 |
commit | a25d02b144c9560dc3d1139a4a0024b6ade6e21c (patch) | |
tree | a2e6a46c6901e03492632131817c30402dab124b /test/ruby/test_class.rb | |
parent | 44aa21d4aa25c036e1a6178c596f48cd1de9f254 (diff) |
object.c: Module#singleton_class?
* object.c (rb_mod_singleton_p): new method Module#singleton_class? to
return whether the receiver is a singleton class or not.
[ruby-core:51087] [Feature #7609]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_class.rb')
-rw-r--r-- | test/ruby/test_class.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb index 7aed078654..47848f3184 100644 --- a/test/ruby/test_class.rb +++ b/test/ruby/test_class.rb @@ -346,4 +346,10 @@ class TestClass < Test::Unit::TestCase assert_empty(added.grep(->(k) {c == k[0]}), bug5283) assert_equal(:foo, d.foo) end + + def test_singleton_class_p + feature7609 = '[ruby-core:51087] [Feature #7609]' + assert_predicate(self.singleton_class, :singleton_class?, feature7609) + assert_not_predicate(self.class, :singleton_class?, feature7609) + end end |