Module: Test::Unit::RunCount

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

Constant Summary collapse

@@run_count =
0

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.have_run?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/test/unit.rb', line 15

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

.run_onceObject



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

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

Instance Method Details

#runObject



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

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