aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-01-07 13:19:48 -0800
committerYehuda Katz <wycats@gmail.com>2009-01-09 00:14:27 -0800
commitc2d23affad0ed4542e3906c334a7b27b07fc695c (patch)
tree6045d4164363854a6dd917fcbf4af42a299bcfa8 /activesupport/test
parentb1530545d259c144770bd8fd7881cb16160c0afc (diff)
downloadrails-c2d23affad0ed4542e3906c334a7b27b07fc695c.tar.gz
rails-c2d23affad0ed4542e3906c334a7b27b07fc695c.tar.bz2
rails-c2d23affad0ed4542e3906c334a7b27b07fc695c.zip
Object#tap for Ruby < 1.8.7
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/object_ext_test.rb8
1 files changed, 8 insertions, 0 deletions
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