diff options
author | Nobuyoshi Nakada <[email protected]> | 2020-02-09 11:07:01 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2020-04-01 15:36:20 +0900 |
commit | 3a2073e61b6ccce6d07d31ebd89d4c385b9a55f2 (patch) | |
tree | b4697ea23f16f340589d27b4f4c046233b2bd106 /spec/ruby/core/array/shared | |
parent | 151f8be40d385ada2ebf7feb84210ed7db7ef4df (diff) |
Use FrozenError instead of frozen_error_class
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2892
Diffstat (limited to 'spec/ruby/core/array/shared')
-rw-r--r-- | spec/ruby/core/array/shared/collect.rb | 16 | ||||
-rw-r--r-- | spec/ruby/core/array/shared/keep_if.rb | 8 | ||||
-rw-r--r-- | spec/ruby/core/array/shared/push.rb | 6 | ||||
-rw-r--r-- | spec/ruby/core/array/shared/replace.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/array/shared/unshift.rb | 8 |
5 files changed, 21 insertions, 21 deletions
diff --git a/spec/ruby/core/array/shared/collect.rb b/spec/ruby/core/array/shared/collect.rb index cbe32d2ab4..d84432734a 100644 --- a/spec/ruby/core/array/shared/collect.rb +++ b/spec/ruby/core/array/shared/collect.rb @@ -114,22 +114,22 @@ describe :array_collect_b, shared: true do end describe "when frozen" do - it "raises a #{frozen_error_class}" do - -> { ArraySpecs.frozen_array.send(@method) {} }.should raise_error(frozen_error_class) + it "raises a FrozenError" do + -> { ArraySpecs.frozen_array.send(@method) {} }.should raise_error(FrozenError) end - it "raises a #{frozen_error_class} when empty" do - -> { ArraySpecs.empty_frozen_array.send(@method) {} }.should raise_error(frozen_error_class) + it "raises a FrozenError when empty" do + -> { ArraySpecs.empty_frozen_array.send(@method) {} }.should raise_error(FrozenError) end - it "raises a #{frozen_error_class} when calling #each on the returned Enumerator" do + it "raises a FrozenError when calling #each on the returned Enumerator" do enumerator = ArraySpecs.frozen_array.send(@method) - -> { enumerator.each {|x| x } }.should raise_error(frozen_error_class) + -> { enumerator.each {|x| x } }.should raise_error(FrozenError) end - it "raises a #{frozen_error_class} when calling #each on the returned Enumerator when empty" do + it "raises a FrozenError when calling #each on the returned Enumerator when empty" do enumerator = ArraySpecs.empty_frozen_array.send(@method) - -> { enumerator.each {|x| x } }.should raise_error(frozen_error_class) + -> { enumerator.each {|x| x } }.should raise_error(FrozenError) end end diff --git a/spec/ruby/core/array/shared/keep_if.rb b/spec/ruby/core/array/shared/keep_if.rb index 2f1299c2b3..f26aff028c 100644 --- a/spec/ruby/core/array/shared/keep_if.rb +++ b/spec/ruby/core/array/shared/keep_if.rb @@ -41,8 +41,8 @@ describe :keep_if, shared: true do @frozen.should == @origin end - it "raises a #{frozen_error_class}" do - -> { @frozen.send(@method) { true } }.should raise_error(frozen_error_class) + it "raises a FrozenError" do + -> { @frozen.send(@method) { true } }.should raise_error(FrozenError) end end @@ -52,8 +52,8 @@ describe :keep_if, shared: true do @frozen.should == @origin end - it "raises a #{frozen_error_class}" do - -> { @frozen.send(@method) { false } }.should raise_error(frozen_error_class) + it "raises a FrozenError" do + -> { @frozen.send(@method) { false } }.should raise_error(FrozenError) end end end diff --git a/spec/ruby/core/array/shared/push.rb b/spec/ruby/core/array/shared/push.rb index df307073cd..ac790fb6a4 100644 --- a/spec/ruby/core/array/shared/push.rb +++ b/spec/ruby/core/array/shared/push.rb @@ -26,8 +26,8 @@ describe :array_push, shared: true do array.send(@method, :last).should == [1, 'two', 3.0, array, array, array, array, array, :last] end - it "raises a #{frozen_error_class} on a frozen array" do - -> { ArraySpecs.frozen_array.send(@method, 1) }.should raise_error(frozen_error_class) - -> { ArraySpecs.frozen_array.send(@method) }.should raise_error(frozen_error_class) + it "raises a FrozenError on a frozen array" do + -> { ArraySpecs.frozen_array.send(@method, 1) }.should raise_error(FrozenError) + -> { ArraySpecs.frozen_array.send(@method) }.should raise_error(FrozenError) end end diff --git a/spec/ruby/core/array/shared/replace.rb b/spec/ruby/core/array/shared/replace.rb index b3474fad09..9a6e60c1b0 100644 --- a/spec/ruby/core/array/shared/replace.rb +++ b/spec/ruby/core/array/shared/replace.rb @@ -52,9 +52,9 @@ describe :array_replace, shared: true do [].send(@method, ArraySpecs::ToAryArray[5, 6, 7]).should == [5, 6, 7] end - it "raises a #{frozen_error_class} on a frozen array" do + it "raises a FrozenError on a frozen array" do -> { ArraySpecs.frozen_array.send(@method, ArraySpecs.frozen_array) - }.should raise_error(frozen_error_class) + }.should raise_error(FrozenError) end end diff --git a/spec/ruby/core/array/shared/unshift.rb b/spec/ruby/core/array/shared/unshift.rb index be62084e95..fc82e19e2a 100644 --- a/spec/ruby/core/array/shared/unshift.rb +++ b/spec/ruby/core/array/shared/unshift.rb @@ -35,12 +35,12 @@ describe :array_unshift, shared: true do array[0..5].should == [:new, 1, 'two', 3.0, array, array] end - it "raises a #{frozen_error_class} on a frozen array when the array is modified" do - -> { ArraySpecs.frozen_array.send(@method, 1) }.should raise_error(frozen_error_class) + it "raises a FrozenError on a frozen array when the array is modified" do + -> { ArraySpecs.frozen_array.send(@method, 1) }.should raise_error(FrozenError) end # see [ruby-core:23666] - it "raises a #{frozen_error_class} on a frozen array when the array would not be modified" do - -> { ArraySpecs.frozen_array.send(@method) }.should raise_error(frozen_error_class) + it "raises a FrozenError on a frozen array when the array would not be modified" do + -> { ArraySpecs.frozen_array.send(@method) }.should raise_error(FrozenError) end end |