Skip to content

Commit

Permalink
spec for Symbol#name to return _same String instance_
Browse files Browse the repository at this point in the history
  • Loading branch information
lxxxvi authored and eregon committed Jan 8, 2021
1 parent df94ad8 commit 5f095a1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/symbol/name_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

ruby_version_is "3.0" do
describe "Symbol#name" do
it "returns a string" do
it "returns string" do
:ruby.name.should == "ruby"
:ルビー.name.should == "ルビー"
:"ruby_#{1+2}".name.should == "ruby_3"
end

it "returns a frozen string" do
it "returns same string instance" do
:"ruby_3".name.should.equal?(:ruby_3.name)
:"ruby_#{1+2}".name.should.equal?(:ruby_3.name)
end

it "returns frozen string" do
:symbol.name.should.frozen?
end
end
Expand Down

0 comments on commit 5f095a1

Please sign in to comment.