Skip to content

Commit 2cc660c

Browse files
author
Lillian Zhang
committed
Add spec that GC.stat values increase after GC is run
1 parent e0bcff0 commit 2cc660c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spec/ruby/core/gc/stat_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,16 @@
1313
stat.should be_kind_of(Hash)
1414
stat.keys.should include(:count)
1515
end
16+
17+
it "increases count after GC is run" do
18+
count = GC.stat(:count)
19+
GC.start
20+
(GC.stat(:count) > count).should be_true
21+
end
22+
23+
it "increases major_gc_count after GC is run" do
24+
count = GC.stat(:major_gc_count)
25+
GC.start
26+
(GC.stat(:major_gc_count) > count).should be_true
27+
end
1628
end

0 commit comments

Comments
 (0)