Module: Minitest::GCStats

Defined in:
lib/minitest/gcstats.rb

Defined Under Namespace

Modules: Result

Constant Summary collapse

VERSION =
"1.3.2"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#gc_statsObject

Returns the value of attribute gc_stats.



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

def gc_stats
  @gc_stats
end

Class Method Details

.currentObject



10
11
12
# File 'lib/minitest/gcstats.rb', line 10

def self.current
  GC.stat :total_allocated_objects
end

Instance Method Details

#after_teardownObject



25
26
27
28
# File 'lib/minitest/gcstats.rb', line 25

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

#before_setupObject



20
21
22
23
# File 'lib/minitest/gcstats.rb', line 20

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

#runObject



14
15
16
17
18
# File 'lib/minitest/gcstats.rb', line 14

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