Module: Minitest::GCStats

Defined in:
lib/minitest/gcstats.rb

Defined Under Namespace

Modules: Result

Constant Summary collapse

VERSION =
"1.3.1"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#gc_statsObject

Returns the value of attribute gc_stats.



6
7
8
# File 'lib/minitest/gcstats.rb', line 6

def gc_stats
  @gc_stats
end

Class Method Details

.currentObject



8
9
10
# File 'lib/minitest/gcstats.rb', line 8

def self.current
  GC.stat :total_allocated_objects
end

Instance Method Details

#after_teardownObject



23
24
25
26
# File 'lib/minitest/gcstats.rb', line 23

def after_teardown
  self.gc_stats += Minitest::GCStats.current
  super
end

#before_setupObject



18
19
20
21
# File 'lib/minitest/gcstats.rb', line 18

def before_setup
  super
  self.gc_stats = -Minitest::GCStats.current
end

#runObject



12
13
14
15
16
# File 'lib/minitest/gcstats.rb', line 12

def run
  r = super
  r.gc_stats = self.gc_stats
  r
end