aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/object_ext_test.rb
blob: 72e3bffa4c99525c1ef9a601dcb397710f4f30fe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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

  def test_to_param
    foo = Object.new
    foo.class_eval("def to_s; 'foo'; end")
    assert_equal 'foo', foo.to_param
  end
end