aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/class
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-07-18 08:18:39 -0700
committerJeremy Evans <code@jeremyevans.net>2020-11-13 07:06:13 -0800
commitce9beb9d20187c861462282460b998684759e5e7 (patch)
treecb20c96125ee71ee3335bf15a8feefd370074d31 /spec/ruby/core/class
parent6d05967468ea58ba481259718f07b3cb5a386945 (diff)
downloadruby-ce9beb9d20187c861462282460b998684759e5e7.tar.gz
Improve error message when subclassing non-Class
Fixes [Bug #14726]
Diffstat (limited to 'spec/ruby/core/class')
-rw-r--r--spec/ruby/core/class/new_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/ruby/core/class/new_spec.rb b/spec/ruby/core/class/new_spec.rb
index f863766c1a..93152a83ee 100644
--- a/spec/ruby/core/class/new_spec.rb
+++ b/spec/ruby/core/class/new_spec.rb
@@ -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)