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.

Methods

Classes and Modules

Module Handoff::ArgumentNormalizer
Class Handoff::Assertion
Class Handoff::UsageError
Class Handoff::VerifyingDelegate

Constants

TEARDOWN_ALIAS = :teardown_before_handoff_rewrite

External Aliases

teardown -> TEARDOWN_ALIAS

Public Class methods

[Source]

# File lib/handoff.rb, line 23
      def teardown
        conduct_and_clear_handoffs
        send TEARDOWN_ALIAS
      end

Public Instance methods

[Source]

# File lib/handoff.rb, line 12
  def assert_handoff
    ensure_handoff_teardown_defined
    a = Handoff::Assertion.new(self, caller)
    handoff_assertions << a
    a
  end

[Source]

# File lib/handoff.rb, line 34
  def conduct_and_clear_handoffs
    begin
      handoff_assertions.each {|a| a.conduct }
    ensure
      handoff_assertions.clear
    end
  end

[Source]

# 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

[Source]

# File lib/handoff.rb, line 30
  def handoff_assertions
    @handoff_assertions ||= []
  end

[Validate]