1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2022-01-10 16:29:54 +01:00
parent 8abfc10605
commit 4053e8ba0d
42 changed files with 470 additions and 84 deletions

View file

@ -17,6 +17,19 @@ describe "The class keyword" do
eval "class ClassSpecsKeywordWithoutSemicolon end"
ClassSpecsKeywordWithoutSemicolon.should be_an_instance_of(Class)
end
it "can redefine a class when called from a block" do
ClassSpecs::DEFINE_CLASS.call
A.should be_an_instance_of(Class)
Object.send(:remove_const, :A)
defined?(A).should be_nil
ClassSpecs::DEFINE_CLASS.call
A.should be_an_instance_of(Class)
ensure
Object.send(:remove_const, :A) if defined?(::A)
end
end
describe "A class definition" do