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 2020-09-30 12:21:48 +02:00
parent ce986b41ca
commit 201d501640
17 changed files with 209 additions and 6 deletions

View file

@ -80,4 +80,12 @@ describe "Kernel#freeze" do
o.freeze
-> {o.instance_variable_set(:@foo, 1)}.should raise_error(RuntimeError)
end
it "freezes an object's singleton class" do
o = Object.new
c = o.singleton_class
c.frozen?.should == false
o.freeze
c.frozen?.should == true
end
end