ruby-changes:57938
From: Jean <ko1@a...>
Date: Thu, 26 Sep 2019 23:30:13 +0900 (JST)
Subject: [ruby-changes:57938] 5b9d646944 (master): Fix Module#name news and add a test
https://git.ruby-lang.org/ruby.git/commit/?id=5b9d646944 From 5b9d646944fe3a2f92682be906b0e9c7beae323c Mon Sep 17 00:00:00 2001 From: Jean Boussier <jean.boussier@g...> Date: Thu, 26 Sep 2019 13:41:41 +0200 Subject: Fix Module#name news and add a test diff --git a/NEWS b/NEWS index 9010d5d..dd461a3 100644 --- a/NEWS +++ b/NEWS @@ -176,8 +176,8 @@ Module:: https://github.com/ruby/ruby/blob/trunk/NEWS#L176 Module#const_defined?. [Feature #15777] * Module#name now always return a frozen String. The returned String is - always the same for a given Module. This change is experimental - [Feature #16150] + always the same for a given Module. This change is + experimental. [Feature #16150] ObjectSpace::WeakMap:: diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 8689c60..8b95ece 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -563,6 +563,10 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L563 assert_equal("Integer", Integer.name) assert_equal("TestModule::Mixin", Mixin.name) assert_equal("TestModule::User", User.name) + + assert_predicate Integer.name, :frozen? + assert_predicate Mixin.name, :frozen? + assert_predicate User.name, :frozen? end def test_accidental_singleton_naming_with_module -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/