summaryrefslogtreecommitdiff
path: root/spec/ruby/core/hash/to_proc_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/hash/to_proc_spec.rb')
-rw-r--r--spec/ruby/core/hash/to_proc_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/ruby/core/hash/to_proc_spec.rb b/spec/ruby/core/hash/to_proc_spec.rb
index 9dbc79e5eb..bc4756600d 100644
--- a/spec/ruby/core/hash/to_proc_spec.rb
+++ b/spec/ruby/core/hash/to_proc_spec.rb
@@ -11,7 +11,7 @@ describe "Hash#to_proc" do
end
it "returns an instance of Proc" do
- @hash.to_proc.should be_an_instance_of Proc
+ @hash.to_proc.should.instance_of? Proc
end
describe "the returned proc" do
@@ -30,22 +30,22 @@ describe "Hash#to_proc" do
it "raises ArgumentError if not passed exactly one argument" do
-> {
@proc.call
- }.should raise_error(ArgumentError)
+ }.should.raise(ArgumentError)
-> {
@proc.call 1, 2
- }.should raise_error(ArgumentError)
+ }.should.raise(ArgumentError)
end
context "with a stored key" do
it "returns the paired value" do
- @proc.call(@key).should equal(@value)
+ @proc.call(@key).should.equal?(@value)
end
end
context "passed as a block" do
it "retrieves the hash's values" do
- [@key].map(&@proc)[0].should equal(@value)
+ [@key].map(&@proc)[0].should.equal?(@value)
end
context "to instance_exec" do
@@ -63,7 +63,7 @@ describe "Hash#to_proc" do
context "with no stored key" do
it "returns nil" do
- @proc.call(@unstored).should be_nil
+ @proc.call(@unstored).should == nil
end
context "when the hash has a default value" do
@@ -72,7 +72,7 @@ describe "Hash#to_proc" do
end
it "returns the default value" do
- @proc.call(@unstored).should equal(@default)
+ @proc.call(@unstored).should.equal?(@default)
end
end
@@ -85,7 +85,7 @@ describe "Hash#to_proc" do
end
it "raises an ArgumentError when calling #call on the Proc with no arguments" do
- -> { @hash.to_proc.call }.should raise_error(ArgumentError)
+ -> { @hash.to_proc.call }.should.raise(ArgumentError)
end
end
end