instiki/vendor/rails/activesupport/test/core_ext/proc_test.rb
2007-01-22 07:43:50 -06:00

12 lines
378 B
Ruby

require 'test/unit'
require File.dirname(__FILE__) + '/../../lib/active_support/core_ext/proc'
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
end