Class: ActiveSupport::TestCase

Inherits:
Test::Unit::TestCase show all
Defined in:
lib/before_test.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.before_test(test, proc) ⇒ Object



16
17
18
# File 'lib/before_test.rb', line 16

def before_test test, proc
  @@___before_tests.merge!({test.to_s => proc})
end

Instance Method Details

#original_runObject



6
# File 'lib/before_test.rb', line 6

alias_method :original_run, :run

#run(result, &block) ⇒ Object



8
9
10
11
# File 'lib/before_test.rb', line 8

def run(result,&block)
  send(@@___before_tests[method_name]) if @@___before_tests[method_name]
  original_run(result,&block)
end