1
# Author:: Nathaniel Talbott.
2
# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
3
# License:: Ruby license.
6
require 'test/unit/util/procwrapper'
11
class TC_ProcWrapper < TestCase
12
def munge_proc(&a_proc)
17
@munged = munge_proc(&@original)
18
@wrapped_original = ProcWrapper.new(@original)
19
@wrapped_munged = ProcWrapper.new(@munged)
22
assert_same(@original, @wrapped_original.to_proc, "The wrapper should return what was wrapped")
26
assert_equal(@wrapped_original.hash, @wrapped_munged.hash, "The original and munged should have the same hash when wrapped")
27
assert_equal(@wrapped_original, @wrapped_munged, "The wrappers should be equivalent")
29
a_hash = {@wrapped_original => @original}
30
assert(a_hash[@wrapped_original], "Should be able to access the wrapper in the hash")
31
assert_equal(a_hash[@wrapped_original], @original, "Should be able to access the wrapper in the hash")