summaryrefslogtreecommitdiff
path: root/spec/ruby/core/hash/clear_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/hash/clear_spec.rb')
-rw-r--r--spec/ruby/core/hash/clear_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/ruby/core/hash/clear_spec.rb b/spec/ruby/core/hash/clear_spec.rb
index ea8235451a..beff925a63 100644
--- a/spec/ruby/core/hash/clear_spec.rb
+++ b/spec/ruby/core/hash/clear_spec.rb
@@ -1,10 +1,10 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
+require_relative '../../spec_helper'
+require_relative 'fixtures/classes'
describe "Hash#clear" do
it "removes all key, value pairs" do
h = { 1 => 2, 3 => 4 }
- h.clear.should equal(h)
+ h.clear.should.equal?(h)
h.should == {}
end
@@ -25,8 +25,8 @@ describe "Hash#clear" do
h.default_proc.should_not == nil
end
- it "raises a RuntimeError if called on a frozen instance" do
- lambda { HashSpecs.frozen_hash.clear }.should raise_error(RuntimeError)
- lambda { HashSpecs.empty_frozen_hash.clear }.should raise_error(RuntimeError)
+ it "raises a FrozenError if called on a frozen instance" do
+ -> { HashSpecs.frozen_hash.clear }.should.raise(FrozenError)
+ -> { HashSpecs.empty_frozen_hash.clear }.should.raise(FrozenError)
end
end