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

Improve error message when subclassing non-Class

Fixes [Bug #14726]
This commit is contained in:
Jeremy Evans 2020-07-18 08:18:39 -07:00
parent 6d05967468
commit ce9beb9d20
Notes: git 2020-11-14 00:06:56 +09:00
4 changed files with 4 additions and 4 deletions

View file

@ -95,7 +95,7 @@ describe "Class.new" do
end
it "raises a TypeError when given a non-Class" do
error_msg = /superclass must be a Class/
error_msg = /superclass must be a.*Class/
-> { Class.new("") }.should raise_error(TypeError, error_msg)
-> { Class.new(1) }.should raise_error(TypeError, error_msg)
-> { Class.new(:symbol) }.should raise_error(TypeError, error_msg)