Use an isolated class
The number of all instances of `Class` may be affected by GC-able anonymous classes created by other tests.
This commit is contained in:
parent
5805b1472a
commit
7f3786c3e8
@ -13,9 +13,10 @@ describe "ObjectSpace.memsize_of_all" do
|
||||
end
|
||||
|
||||
it "increases when a new object is allocated" do
|
||||
before = ObjectSpace.memsize_of_all(Class)
|
||||
o = Class.new
|
||||
after = ObjectSpace.memsize_of_all(Class)
|
||||
c = Class.new
|
||||
before = ObjectSpace.memsize_of_all(c)
|
||||
o = c.new
|
||||
after = ObjectSpace.memsize_of_all(c)
|
||||
after.should > before
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user