From 0f9e65b71f9af30dac17689e81f4353e9fcac5b6 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 7 Jan 2009 13:19:48 -0800 Subject: Object#tap for Ruby < 1.8.7 --- activesupport/test/core_ext/object_ext_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 activesupport/test/core_ext/object_ext_test.rb (limited to 'activesupport/test/core_ext') diff --git a/activesupport/test/core_ext/object_ext_test.rb b/activesupport/test/core_ext/object_ext_test.rb new file mode 100644 index 0000000000..a413d331c4 --- /dev/null +++ b/activesupport/test/core_ext/object_ext_test.rb @@ -0,0 +1,8 @@ +require 'abstract_unit' + +class ObjectExtTest < Test::Unit::TestCase + def test_tap_yields_and_returns_self + foo = Object.new + assert_equal foo, foo.tap { |x| assert_equal foo, x; :bar } + end +end -- cgit v1.2.3