summaryrefslogtreecommitdiff
path: root/test/ruby/test_symbol.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-09-04 22:18:59 +0900
committerGitHub <noreply@github.com>2020-09-04 22:18:59 +0900
commiteb67c603ca7e435181684857e650b4633fda5bb6 (patch)
tree2a7079315d7143010d9f561a2bb322f6378a96e9 /test/ruby/test_symbol.rb
parentd7406ccc2c99009cc2af56d5b01c411f8bb673f6 (diff)
Added Symbol#name
https://bugs.ruby-lang.org/issues/16150#change-87446
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3514 Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'test/ruby/test_symbol.rb')
-rw-r--r--test/ruby/test_symbol.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb
index f6ef70f3df..f7f17b8d67 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -105,6 +105,12 @@ class TestSymbol < Test::Unit::TestCase
end
end
+ def test_name
+ assert_equal("foo", :foo.name)
+ assert_same(:foo.name, :foo.name)
+ assert_predicate(:foo.name, :frozen?)
+ end
+
def test_to_proc
assert_equal %w(1 2 3), (1..3).map(&:to_s)
[