aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/module/name_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-02-28 19:07:17 +0100
committerBenoit Daloze <eregontp@gmail.com>2020-02-28 19:07:17 +0100
commita0f5ff4c3cd05f8717be2bf1d79f0817f288d398 (patch)
tree441f409cf816cf8a61dacdbaf204ae9f5cbe2f18 /spec/ruby/core/module/name_spec.rb
parent5d210501825e1682e68cbfc2be424fc339f382fa (diff)
downloadruby-a0f5ff4c3cd05f8717be2bf1d79f0817f288d398.tar.gz
Update to ruby/spec@41bf282
Diffstat (limited to 'spec/ruby/core/module/name_spec.rb')
-rw-r--r--spec/ruby/core/module/name_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/core/module/name_spec.rb b/spec/ruby/core/module/name_spec.rb
index 36a91f5be5..9a4730313f 100644
--- a/spec/ruby/core/module/name_spec.rb
+++ b/spec/ruby/core/module/name_spec.rb
@@ -18,6 +18,12 @@ describe "Module#name" do
m::N.name.should =~ /\A#<Module:0x[0-9a-f]+>::N\z/
end
+ it "returns nil for a singleton class" do
+ Module.new.singleton_class.name.should be_nil
+ String.singleton_class.name.should be_nil
+ Object.new.singleton_class.name.should be_nil
+ end
+
it "changes when the module is reachable through a constant path" do
m = Module.new
module m::N; end