mirror of
https://github.com/ruby/ruby.git
synced 2025-09-24 04:54:01 +02:00
class.c: refine error messages
* class.c (rb_define_class, rb_define_class_id_under): refine error messages. * class.c (rb_define_module, rb_define_module_id_under): ditto, and make consistent with class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dca6009c3e
commit
eb47de3005
4 changed files with 42 additions and 11 deletions
|
@ -2103,6 +2103,13 @@ class TestModule < Test::Unit::TestCase
|
|||
assert_raise_with_message(TypeError, "#{n} is not a module") {
|
||||
m.module_eval "module #{n}; end"
|
||||
}
|
||||
|
||||
assert_separately([], <<-"end;")
|
||||
Etc = (class C\u{1f5ff}; self; end).new
|
||||
assert_raise_with_message(TypeError, /C\u{1f5ff}/) {
|
||||
require 'etc'
|
||||
}
|
||||
end;
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue