aboutsummaryrefslogblamecommitdiffstats
path: root/activesupport/test/core_ext/object/to_param_test.rb
blob: c3efefddb5f366778568af904c5dac6b701034e1 (plain) (tree)


















                                                 
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