aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/proc_test.rb
blob: f63cd82d22fa6f83394cd53b29e3af97f6c9f1a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
require File.dirname(__FILE__) + '/../abstract_unit'

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