require File.dirname(__FILE__) + '/../abstract_unit'

class DuplicableTest < Test::Unit::TestCase
  NO  = [nil, false, true, :symbol, 1, 2.3, BigDecimal.new('4.56')]
  YES = ['1', Object.new, /foo/, [], {}]

  def test_duplicable
    NO.each do |v|
      assert !v.duplicable?
      begin
        v.dup
        fail
      rescue Exception
      end
    end

    YES.each do |v|
      assert v.duplicable?
      assert_nothing_raised { v.dup }
    end
  end
end

require File.dirname(__FILE__) + '/../abstract_unit'

class DuplicableTest < Test::Unit::TestCase
  NO  = [nil, false, true, :symbol, 1, 2.3, BigDecimal.new('4.56')]
  YES = ['1', Object.new, /foo/, [], {}, Time.now]

  def test_duplicable
    NO.each do |v|
      assert !v.duplicable?
      begin
        v.dup
        fail
      rescue Exception
      end
    end

    YES.each do |v|
      assert v.duplicable?
      assert_nothing_raised { v.dup }
    end
  end
end

Add a time to duplicable tests
Add a time to duplicable tests


git-svn-id: afc9fed30c1a09d8801d1e4fbe6e01c29c67d11f@7907 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
