summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/clone_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/clone_spec.rb')
-rw-r--r--spec/ruby/core/string/clone_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/ruby/core/string/clone_spec.rb b/spec/ruby/core/string/clone_spec.rb
index f8d40423f0..2cb289d2c1 100644
--- a/spec/ruby/core/string/clone_spec.rb
+++ b/spec/ruby/core/string/clone_spec.rb
@@ -43,8 +43,8 @@ describe "String#clone" do
end
it "copies frozen state" do
- @obj.freeze.clone.frozen?.should be_true
- "".freeze.clone.frozen?.should be_true
+ @obj.freeze.clone.frozen?.should == true
+ "".freeze.clone.frozen?.should == true
end
it "does not modify the original string when changing cloned string" do
@@ -54,4 +54,8 @@ describe "String#clone" do
orig.should == "xtring"
clone.should == "string"
end
+
+ it "returns a String in the same encoding as self" do
+ "a".encode("US-ASCII").clone.encoding.should == Encoding::US_ASCII
+ end
end