Sha256: f324fcaa779324d9f19b6c8783b5569d15e75ff90961091dcf9cb0955498c81d

Contents?: true

Size: 453 Bytes

Versions: 6

Compression:

Stored size: 453 Bytes

Contents

require 'abstract_unit'

class DuplicableTest < Test::Unit::TestCase
  NO  = [nil, false, true, :symbol, 1, 2.3, BigDecimal.new('4.56'), Class.new]
  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

Version data entries

6 entries across 5 versions & 3 rubygems

Version Path
kajam-1.0.3.rc2 vendor/rails/activesupport/test/core_ext/duplicable_test.rb
radiant-1.0.0.rc2 vendor/rails/activesupport/test/core_ext/duplicable_test.rb
radiant-1.0.0.rc1 vendor/rails/activesupport/test/core_ext/duplicable_test.rb
radiant-0.9.0.rc2 vendor/rails/activesupport/test/core_ext/duplicable_test.rb
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/activesupport/test/core_ext/duplicable_test.rb
usher-0.7.0 spec/rails2_3/vendor/rails/vendor/rails/activesupport/test/core_ext/duplicable_test.rb