2007-02-09 09:04:31 +01:00
|
|
|
require File.dirname(__FILE__) + '/../abstract_unit'
|
2007-01-22 14:43:50 +01:00
|
|
|
|
|
|
|
class ProcTests < Test::Unit::TestCase
|
|
|
|
def test_bind_returns_method_with_changed_self
|
|
|
|
block = Proc.new { self }
|
|
|
|
assert_equal self, block.call
|
|
|
|
bound_block = block.bind("hello")
|
|
|
|
assert_not_equal block, bound_block
|
|
|
|
assert_equal "hello", bound_block.call
|
|
|
|
end
|
2007-02-09 09:04:31 +01:00
|
|
|
end
|