aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/object/to_param_test.rb
blob: c3efefddb5f366778568af904c5dac6b701034e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'abstract_unit'
require 'active_support/core_ext/object/to_param'

class ToParamTest < Test::Unit::TestCase
  def test_object
    foo = Object.new
    def foo.to_s; 'foo' end
    assert_equal 'foo', foo.to_param
  end

  def test_nil
    assert_nil nil.to_param
  end

  def test_boolean
    assert_equal true, true.to_param
    assert_equal false, false.to_param
  end
end