test/measure_memory_test.rb in ruby-prof-0.15.7 vs test/measure_memory_test.rb in ruby-prof-0.15.8

- old
+ new

@@ -15,17 +15,19 @@ assert(defined?(RubyProf::MEMORY_ENABLED)) end if RubyProf::MEMORY_ENABLED def test_memory + RubyProf::measure_mode = RubyProf::MEMORY + RubyProf.enable_gc_stats_if_needed t = RubyProf.measure_memory assert_kind_of Float, t - u = RubyProf.measure_memory - assert(u > t, [t, u].inspect) - RubyProf::measure_mode = RubyProf::MEMORY + assert_operator u, :>, t total = memory_test_helper assert(total > 0, 'Should measure more than zero kilobytes of memory usage') refute_equal(0, total % 1, 'Should not truncate fractional kilobyte measurements') + ensure + RubyProf.disable_gc_stats_if_needed end end end