| Module | Handoff |
| In: |
lib/handoff.rb
lib/handoff/argument_normalizer.rb lib/handoff/assertion.rb lib/handoff/usage_error.rb lib/handoff/verifying_delegate.rb |
require (or require_gem) ‘handoff’ and assert_handoff can be called from any Test::Unit::TestCase test method to create a new Handoff::Assertion.
After defining Handoff, this file includes it in Test::Unit::TestCase.
| TEARDOWN_ALIAS | = | :teardown_before_handoff_rewrite |
| teardown | -> | TEARDOWN_ALIAS |
# File lib/handoff.rb, line 12 def assert_handoff ensure_handoff_teardown_defined a = Handoff::Assertion.new(self, caller) handoff_assertions << a a end
# File lib/handoff.rb, line 34 def conduct_and_clear_handoffs begin handoff_assertions.each {|a| a.conduct } ensure handoff_assertions.clear end end
# File lib/handoff.rb, line 19 def ensure_handoff_teardown_defined return if respond_to?(TEARDOWN_ALIAS) class << self alias_method TEARDOWN_ALIAS, :teardown def teardown conduct_and_clear_handoffs send TEARDOWN_ALIAS end end end