1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2019-07-27 12:40:09 +02:00
parent a06301b103
commit 5c276e1cc9
1247 changed files with 5316 additions and 5028 deletions

View file

@ -32,19 +32,19 @@ describe :hash_replace, shared: true do
hash_a.default(5).should == 10
hash_a = Hash.new { |h, k| k * 5 }
hash_b = Hash.new(lambda { raise "Should not invoke lambda" })
hash_b = Hash.new(-> { raise "Should not invoke lambda" })
hash_a.send(@method, hash_b)
hash_a.default.should == hash_b.default
end
it "raises a #{frozen_error_class} if called on a frozen instance that would not be modified" do
lambda do
-> do
HashSpecs.frozen_hash.send(@method, HashSpecs.frozen_hash)
end.should raise_error(frozen_error_class)
end
it "raises a #{frozen_error_class} if called on a frozen instance that is modified" do
lambda do
-> do
HashSpecs.frozen_hash.send(@method, HashSpecs.empty_frozen_hash)
end.should raise_error(frozen_error_class)
end