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.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/ruby/core/string/clone_spec.rb b/spec/ruby/core/string/clone_spec.rb
index 3940858e53..2cb289d2c1 100644
--- a/spec/ruby/core/string/clone_spec.rb
+++ b/spec/ruby/core/string/clone_spec.rb
@@ -1,5 +1,5 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
+require_relative '../../spec_helper'
+require_relative 'fixtures/classes'
describe "String#clone" do
before :each do
@@ -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,5 +54,8 @@ describe "String#clone" do
orig.should == "xtring"
clone.should == "string"
end
-end
+ it "returns a String in the same encoding as self" do
+ "a".encode("US-ASCII").clone.encoding.should == Encoding::US_ASCII
+ end
+end