1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use FrozenError instead of frozen_error_class

This commit is contained in:
Nobuyoshi Nakada 2020-02-09 11:07:01 +09:00
parent 151f8be40d
commit 3a2073e61b
Notes: git 2020-04-01 15:36:48 +09:00
103 changed files with 367 additions and 385 deletions

View file

@ -272,15 +272,15 @@ describe "Array#flatten!" do
ary.should == [1, 2, 3]
end
it "raises a #{frozen_error_class} on frozen arrays when the array is modified" do
it "raises a FrozenError on frozen arrays when the array is modified" do
nested_ary = [1, 2, []]
nested_ary.freeze
-> { nested_ary.flatten! }.should raise_error(frozen_error_class)
-> { nested_ary.flatten! }.should raise_error(FrozenError)
end
# see [ruby-core:23663]
it "raises a #{frozen_error_class} on frozen arrays when the array would not be modified" do
-> { ArraySpecs.frozen_array.flatten! }.should raise_error(frozen_error_class)
-> { ArraySpecs.empty_frozen_array.flatten! }.should raise_error(frozen_error_class)
it "raises a FrozenError on frozen arrays when the array would not be modified" do
-> { ArraySpecs.frozen_array.flatten! }.should raise_error(FrozenError)
-> { ArraySpecs.empty_frozen_array.flatten! }.should raise_error(FrozenError)
end
end