summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string')
-rw-r--r--spec/ruby/core/string/chr_spec.rb2
-rw-r--r--spec/ruby/core/string/clear_spec.rb2
-rw-r--r--spec/ruby/core/string/freeze_spec.rb5
3 files changed, 4 insertions, 5 deletions
diff --git a/spec/ruby/core/string/chr_spec.rb b/spec/ruby/core/string/chr_spec.rb
index c7834b78b7..a5e0cc4c88 100644
--- a/spec/ruby/core/string/chr_spec.rb
+++ b/spec/ruby/core/string/chr_spec.rb
@@ -4,7 +4,7 @@ with_feature :encoding do
describe "String#chr" do
it "returns a copy of self" do
s = 'e'
- s.object_id.should_not == s.chr.object_id
+ s.should_not equal s.chr
end
it "returns a String" do
diff --git a/spec/ruby/core/string/clear_spec.rb b/spec/ruby/core/string/clear_spec.rb
index c1bab8f39e..3db8b54cb0 100644
--- a/spec/ruby/core/string/clear_spec.rb
+++ b/spec/ruby/core/string/clear_spec.rb
@@ -14,7 +14,7 @@ with_feature :encoding do
it "returns self after emptying it" do
cleared = @s.clear
cleared.should == ""
- cleared.object_id.should == @s.object_id
+ cleared.should equal @s
end
it "preserves its encoding" do
diff --git a/spec/ruby/core/string/freeze_spec.rb b/spec/ruby/core/string/freeze_spec.rb
index bd7c2fbc73..476f50fbed 100644
--- a/spec/ruby/core/string/freeze_spec.rb
+++ b/spec/ruby/core/string/freeze_spec.rb
@@ -3,12 +3,11 @@ require File.expand_path('../../../spec_helper', __FILE__)
describe "String#freeze" do
it "produces the same object whenever called on an instance of a literal in the source" do
- ids = Array.new(2) { "abc".freeze.object_id }
- ids.first.should == ids.last
+ "abc".freeze.should equal "abc".freeze
end
it "doesn't produce the same object for different instances of literals in the source" do
- "abc".object_id.should_not == "abc".object_id
+ "abc".should_not equal "abc"
end
it "being a special form doesn't change the value of defined?" do