mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@4f59d86
This commit is contained in:
parent
342fbae83c
commit
148961adcd
47 changed files with 725 additions and 61 deletions
|
@ -285,6 +285,16 @@ describe "A class definition extending an object (sclass)" do
|
|||
}.should raise_error(TypeError)
|
||||
end
|
||||
|
||||
it "raises a TypeError when trying to extend non-Class" do
|
||||
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)
|
||||
-> { class TestClass < mock('o'); end }.should raise_error(TypeError, error_msg)
|
||||
-> { class TestClass < Module.new; end }.should raise_error(TypeError, error_msg)
|
||||
-> { class TestClass < BasicObject.new; end }.should raise_error(TypeError, error_msg)
|
||||
end
|
||||
|
||||
ruby_version_is ""..."3.0" do
|
||||
it "allows accessing the block of the original scope" do
|
||||
suppress_warning do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue