Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions core/symbol/shared/id2name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,18 @@

symbol.send(@method).encoding.should == Encoding::US_ASCII
end

ruby_version_is "3.4" do
it "warns about mutating returned string" do
-> { :bad!.send(@method).upcase! }.should complain(/warning: string returned by :bad!.to_s will be frozen in the future/)
end

it "does not warn about mutation when Warning[:deprecated] is false" do
deprecated = Warning[:deprecated]
Warning[:deprecated] = false
-> { :bad!.send(@method).upcase! }.should_not complain
ensure
Warning[:deprecated] = deprecated
end
end
end