We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 559c3f0 commit 5ac0a59Copy full SHA for 5ac0a59
core/string/scrub_spec.rb
@@ -105,4 +105,18 @@
105
input.scrub! { |b| "<?>" }
106
input.should == "a<?>"
107
end
108
+
109
+ it "maintains the state of frozen strings that are already valid" do
110
+ input = "a"
111
+ input.freeze
112
+ input.scrub!
113
+ input.frozen?.should be_true
114
+ end
115
116
+ it "preserves the instance variables of already valid strings" do
117
118
+ input.instance_variable_set(:@a, 'b')
119
120
+ input.instance_variable_get(:@a).should == 'b'
121
122
0 commit comments