summaryrefslogtreecommitdiff
path: root/spec/ruby/language/class_spec.rb
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/language/class_spec.rb
parent6d05967468ea58ba481259718f07b3cb5a386945 (diff)
Improve error message when subclassing non-Class
Fixes [Bug #14726]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3330
Diffstat (limited to 'spec/ruby/language/class_spec.rb')
-rw-r--r--spec/ruby/language/class_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/ruby/language/class_spec.rb b/spec/ruby/language/class_spec.rb
index fa30e22c3a..83db164e1a 100644
--- a/spec/ruby/language/class_spec.rb
+++ b/spec/ruby/language/class_spec.rb
@@ -286,7 +286,7 @@ describe "A class definition extending an object (sclass)" do
end
it "raises a TypeError when trying to extend non-Class" do
- error_msg = /superclass must be a Class/
+ error_msg = /superclass must be a.* Class/
-> { class TestClass < ""; end }.should raise_error(TypeError, error_msg)
-> { class TestClass < 1; end }.should raise_error(TypeError, error_msg)
-> { class TestClass < :symbol; end }.should raise_error(TypeError, error_msg)