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/string/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/string/shared')
-rw-r--r-- | spec/ruby/core/string/shared/concat.rb | 12 | ||||
-rw-r--r-- | spec/ruby/core/string/shared/replace.rb | 8 | ||||
-rw-r--r-- | spec/ruby/core/string/shared/succ.rb | 6 |
3 files changed, 13 insertions, 13 deletions
diff --git a/spec/ruby/core/string/shared/concat.rb b/spec/ruby/core/string/shared/concat.rb index 435158496e..d127b08e9c 100644 --- a/spec/ruby/core/string/shared/concat.rb +++ b/spec/ruby/core/string/shared/concat.rb @@ -17,12 +17,12 @@ describe :string_concat, shared: true do -> { 'hello '.send(@method, mock('x')) }.should raise_error(TypeError) end - it "raises a #{frozen_error_class} when self is frozen" do + it "raises a FrozenError when self is frozen" do a = "hello" a.freeze - -> { a.send(@method, "") }.should raise_error(frozen_error_class) - -> { a.send(@method, "test") }.should raise_error(frozen_error_class) + -> { a.send(@method, "") }.should raise_error(FrozenError) + -> { a.send(@method, "test") }.should raise_error(FrozenError) end it "returns a String when given a subclass instance" do @@ -89,12 +89,12 @@ describe :string_concat, shared: true do -> { "".send(@method, x) }.should raise_error(TypeError) end - it "raises a #{frozen_error_class} when self is frozen" do + it "raises a FrozenError when self is frozen" do a = "hello" a.freeze - -> { a.send(@method, 0) }.should raise_error(frozen_error_class) - -> { a.send(@method, 33) }.should raise_error(frozen_error_class) + -> { a.send(@method, 0) }.should raise_error(FrozenError) + -> { a.send(@method, 33) }.should raise_error(FrozenError) end end end diff --git a/spec/ruby/core/string/shared/replace.rb b/spec/ruby/core/string/shared/replace.rb index 620021eb92..3c5a15e12d 100644 --- a/spec/ruby/core/string/shared/replace.rb +++ b/spec/ruby/core/string/shared/replace.rb @@ -64,14 +64,14 @@ describe :string_replace, shared: true do -> { "hello".send(@method, mock('x')) }.should raise_error(TypeError) end - it "raises a #{frozen_error_class} on a frozen instance that is modified" do + it "raises a FrozenError on a frozen instance that is modified" do a = "hello".freeze - -> { a.send(@method, "world") }.should raise_error(frozen_error_class) + -> { a.send(@method, "world") }.should raise_error(FrozenError) end # see [ruby-core:23666] - it "raises a #{frozen_error_class} on a frozen instance when self-replacing" do + it "raises a FrozenError on a frozen instance when self-replacing" do a = "hello".freeze - -> { a.send(@method, a) }.should raise_error(frozen_error_class) + -> { a.send(@method, a) }.should raise_error(FrozenError) end end diff --git a/spec/ruby/core/string/shared/succ.rb b/spec/ruby/core/string/shared/succ.rb index 80e4659102..346ccee409 100644 --- a/spec/ruby/core/string/shared/succ.rb +++ b/spec/ruby/core/string/shared/succ.rb @@ -83,8 +83,8 @@ describe :string_succ_bang, shared: true do end end - it "raises a #{frozen_error_class} if self is frozen" do - -> { "".freeze.send(@method) }.should raise_error(frozen_error_class) - -> { "abcd".freeze.send(@method) }.should raise_error(frozen_error_class) + it "raises a FrozenError if self is frozen" do + -> { "".freeze.send(@method) }.should raise_error(FrozenError) + -> { "abcd".freeze.send(@method) }.should raise_error(FrozenError) end end |