diff options
Diffstat (limited to 'activesupport/test/core_ext/proc_test.rb')
-rw-r--r-- | activesupport/test/core_ext/proc_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/proc_test.rb b/activesupport/test/core_ext/proc_test.rb new file mode 100644 index 0000000000..ca91a257b7 --- /dev/null +++ b/activesupport/test/core_ext/proc_test.rb @@ -0,0 +1,12 @@ +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
\ No newline at end of file |