summaryrefslogtreecommitdiff
path: root/spec/ruby/core/hash/shared
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/hash/shared')
-rw-r--r--spec/ruby/core/hash/shared/replace.rb8
-rw-r--r--spec/ruby/core/hash/shared/store.rb4
-rw-r--r--spec/ruby/core/hash/shared/update.rb10
3 files changed, 11 insertions, 11 deletions
diff --git a/spec/ruby/core/hash/shared/replace.rb b/spec/ruby/core/hash/shared/replace.rb
index 463c861395..eb51130781 100644
--- a/spec/ruby/core/hash/shared/replace.rb
+++ b/spec/ruby/core/hash/shared/replace.rb
@@ -37,15 +37,15 @@ describe :hash_replace, shared: true do
hash_a.default.should == hash_b.default
end
- it "raises a RuntimeError if called on a frozen instance that would not be modified" do
+ it "raises a #{frozen_error_class} if called on a frozen instance that would not be modified" do
lambda do
HashSpecs.frozen_hash.send(@method, HashSpecs.frozen_hash)
- end.should raise_error(RuntimeError)
+ end.should raise_error(frozen_error_class)
end
- it "raises a RuntimeError if called on a frozen instance that is modified" do
+ it "raises a #{frozen_error_class} if called on a frozen instance that is modified" do
lambda do
HashSpecs.frozen_hash.send(@method, HashSpecs.empty_frozen_hash)
- end.should raise_error(RuntimeError)
+ end.should raise_error(frozen_error_class)
end
end
diff --git a/spec/ruby/core/hash/shared/store.rb b/spec/ruby/core/hash/shared/store.rb
index b43dcbc93e..6f8390fd95 100644
--- a/spec/ruby/core/hash/shared/store.rb
+++ b/spec/ruby/core/hash/shared/store.rb
@@ -86,8 +86,8 @@ describe :hash_store, shared: true do
h.keys.last.should_not equal(key2)
end
- it "raises a RuntimeError if called on a frozen instance" do
- lambda { HashSpecs.frozen_hash.send(@method, 1, 2) }.should raise_error(RuntimeError)
+ it "raises a #{frozen_error_class} if called on a frozen instance" do
+ lambda { HashSpecs.frozen_hash.send(@method, 1, 2) }.should raise_error(frozen_error_class)
end
it "does not raise an exception if changing the value of an existing key during iteration" do
diff --git a/spec/ruby/core/hash/shared/update.rb b/spec/ruby/core/hash/shared/update.rb
index b1e3793028..be03ac019e 100644
--- a/spec/ruby/core/hash/shared/update.rb
+++ b/spec/ruby/core/hash/shared/update.rb
@@ -34,10 +34,10 @@ describe :hash_update, shared: true do
merge_bang_pairs.should == merge_pairs
end
- it "raises a RuntimeError on a frozen instance that is modified" do
+ it "raises a #{frozen_error_class} on a frozen instance that is modified" do
lambda do
HashSpecs.frozen_hash.send(@method, 1 => 2)
- end.should raise_error(RuntimeError)
+ end.should raise_error(frozen_error_class)
end
it "checks frozen status before coercing an object with #to_hash" do
@@ -47,13 +47,13 @@ describe :hash_update, shared: true do
def obj.to_hash() raise Exception, "should not receive #to_hash" end
obj.freeze
- lambda { HashSpecs.frozen_hash.send(@method, obj) }.should raise_error(RuntimeError)
+ lambda { HashSpecs.frozen_hash.send(@method, obj) }.should raise_error(frozen_error_class)
end
# see redmine #1571
- it "raises a RuntimeError on a frozen instance that would not be modified" do
+ it "raises a #{frozen_error_class} on a frozen instance that would not be modified" do
lambda do
HashSpecs.frozen_hash.send(@method, HashSpecs.empty_frozen_hash)
- end.should raise_error(RuntimeError)
+ end.should raise_error(frozen_error_class)
end
end