summaryrefslogtreecommitdiff
path: root/spec/ruby/library/weakref
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/weakref')
-rw-r--r--spec/ruby/library/weakref/__getobj___spec.rb4
-rw-r--r--spec/ruby/library/weakref/allocate_spec.rb2
-rw-r--r--spec/ruby/library/weakref/send_spec.rb4
-rw-r--r--spec/ruby/library/weakref/weakref_alive_spec.rb4
4 files changed, 7 insertions, 7 deletions
diff --git a/spec/ruby/library/weakref/__getobj___spec.rb b/spec/ruby/library/weakref/__getobj___spec.rb
index 79b06f5c96..fa507384c2 100644
--- a/spec/ruby/library/weakref/__getobj___spec.rb
+++ b/spec/ruby/library/weakref/__getobj___spec.rb
@@ -5,13 +5,13 @@ describe "WeakRef#__getobj__" do
it "returns the object if it is reachable" do
obj = Object.new
ref = WeakRef.new(obj)
- ref.__getobj__.should equal(obj)
+ ref.__getobj__.should.equal?(obj)
end
it "raises WeakRef::RefError if the object is no longer reachable" do
ref = WeakRefSpec.make_dead_weakref
-> {
ref.__getobj__
- }.should raise_error(WeakRef::RefError)
+ }.should.raise(WeakRef::RefError)
end
end
diff --git a/spec/ruby/library/weakref/allocate_spec.rb b/spec/ruby/library/weakref/allocate_spec.rb
index e734cfd23d..0438d093c4 100644
--- a/spec/ruby/library/weakref/allocate_spec.rb
+++ b/spec/ruby/library/weakref/allocate_spec.rb
@@ -3,6 +3,6 @@ require 'weakref'
describe "WeakRef#allocate" do
it "assigns nil as the reference" do
- -> { WeakRef.allocate.__getobj__ }.should raise_error(WeakRef::RefError)
+ -> { WeakRef.allocate.__getobj__ }.should.raise(WeakRef::RefError)
end
end
diff --git a/spec/ruby/library/weakref/send_spec.rb b/spec/ruby/library/weakref/send_spec.rb
index 9591657e01..da8660066f 100644
--- a/spec/ruby/library/weakref/send_spec.rb
+++ b/spec/ruby/library/weakref/send_spec.rb
@@ -27,11 +27,11 @@ describe "WeakRef#__send__" do
it "delegates to protected methods of the weakly-referenced object" do
wr = WeakRef.new(WeakRefSpecs)
- -> { wr.protected_method }.should raise_error(NameError)
+ -> { wr.protected_method }.should.raise(NameError)
end
it "does not delegate to private methods of the weakly-referenced object" do
wr = WeakRef.new(WeakRefSpecs)
- -> { wr.private_method }.should raise_error(NameError)
+ -> { wr.private_method }.should.raise(NameError)
end
end
diff --git a/spec/ruby/library/weakref/weakref_alive_spec.rb b/spec/ruby/library/weakref/weakref_alive_spec.rb
index 1ebf9c1ee3..1b12ffbbec 100644
--- a/spec/ruby/library/weakref/weakref_alive_spec.rb
+++ b/spec/ruby/library/weakref/weakref_alive_spec.rb
@@ -5,11 +5,11 @@ describe "WeakRef#weakref_alive?" do
it "returns true if the object is reachable" do
obj = Object.new
ref = WeakRef.new(obj)
- ref.weakref_alive?.should be_true
+ ref.weakref_alive?.should == true
end
it "returns a falsy value if the object is no longer reachable" do
ref = WeakRefSpec.make_dead_weakref
- [false, nil].should include(ref.weakref_alive?)
+ [false, nil].should.include?(ref.weakref_alive?)
end
end