Skip to content

Commit 2c6ddd7

Browse files
Lillian Zhangeregon
authored andcommitted
add spec for string#scrub when replacement is frozen
(cherry picked from commit 31f3ed4)
1 parent 4d1a00d commit 2c6ddd7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spec/ruby/core/string/scrub_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,10 @@
119119
input.scrub!
120120
input.instance_variable_get(:@a).should == 'b'
121121
end
122+
123+
it "accepts a frozen string as a replacement" do
124+
input = "a\xE2"
125+
input.scrub!('.'.freeze)
126+
input.should == 'a.'
127+
end
122128
end

0 commit comments

Comments
 (0)