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:
parent
151f8be40d
commit
3a2073e61b
Notes:
git
2020-04-01 15:36:48 +09:00
103 changed files with 367 additions and 385 deletions
|
@ -336,19 +336,19 @@ describe "String#chomp!" do
|
|||
end
|
||||
end
|
||||
|
||||
it "raises a #{frozen_error_class} on a frozen instance when it is modified" do
|
||||
it "raises a FrozenError on a frozen instance when it is modified" do
|
||||
a = "string\n\r"
|
||||
a.freeze
|
||||
|
||||
-> { a.chomp! }.should raise_error(frozen_error_class)
|
||||
-> { a.chomp! }.should raise_error(FrozenError)
|
||||
end
|
||||
|
||||
# see [ruby-core:23666]
|
||||
it "raises a #{frozen_error_class} on a frozen instance when it would not be modified" do
|
||||
it "raises a FrozenError on a frozen instance when it would not be modified" do
|
||||
a = "string\n\r"
|
||||
a.freeze
|
||||
-> { a.chomp!(nil) }.should raise_error(frozen_error_class)
|
||||
-> { a.chomp!("x") }.should raise_error(frozen_error_class)
|
||||
-> { a.chomp!(nil) }.should raise_error(FrozenError)
|
||||
-> { a.chomp!("x") }.should raise_error(FrozenError)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue