summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/chilled_string_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/chilled_string_spec.rb')
-rw-r--r--spec/ruby/core/string/chilled_string_spec.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/spec/ruby/core/string/chilled_string_spec.rb b/spec/ruby/core/string/chilled_string_spec.rb
index b8fb6eedc9..6a5e846db2 100644
--- a/spec/ruby/core/string/chilled_string_spec.rb
+++ b/spec/ruby/core/string/chilled_string_spec.rb
@@ -47,6 +47,14 @@ describe "chilled String" do
input.should == "chilled-mutated"
end
+ it "emits a warning for concatenated strings" do
+ input = "still" "+chilled"
+ -> {
+ input << "-mutated"
+ }.should complain(/literal string will be frozen in the future/)
+ input.should == "still+chilled-mutated"
+ end
+
it "emits a warning on singleton_class creation" do
-> {
"chilled".singleton_class
@@ -64,8 +72,8 @@ describe "chilled String" do
input.freeze
-> {
-> {
- input << "mutated"
- }.should raise_error(FrozenError)
+ input << "mutated"
+ }.should.raise(FrozenError)
}.should_not complain(/literal string will be frozen in the future/)
end
end
@@ -133,8 +141,8 @@ describe "chilled String" do
input.freeze
-> {
-> {
- input << "mutated"
- }.should raise_error(FrozenError)
+ input << "mutated"
+ }.should.raise(FrozenError)
}.should_not complain(/string returned by :chilled\.to_s will be frozen in the future/)
end
end