Module: Test::Unit::RunCount

Included in:
Runner
Defined in:
lib/test/unit.rb

Overview

:nodoc: all

Constant Summary collapse

@@run_count =
0

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.have_run?Boolean



21
22
23
# File 'lib/test/unit.rb', line 21

def self.have_run?
  @@run_count.nonzero?
end

.run_onceObject



30
31
32
33
34
# File 'lib/test/unit.rb', line 30

def run_once
  return if have_run?
  return if $! # don't run if there was an exception
  yield
end

Instance Method Details

#runObject



25
26
27
28
# File 'lib/test/unit.rb', line 25

def run(*)
  @@run_count += 1
  super
end