instiki/vendor/rails/activesupport/test/core_ext/duplicable_test.rb
Jacques Distler 7600aef48b Upgrade to Rails 2.2.0
As a side benefit, fix an (non-user-visible) bug in display_s5().
Also fixed a bug where removing orphaned pages did not expire cached summary pages.
2008-10-27 01:47:01 -05:00

23 lines
453 B
Ruby

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