1 require 'abstract_unit'
\r
2 require 'fixtures/reference_type'
\r
3 require 'fixtures/reference_code'
\r
5 class TestClone < Test::Unit::TestCase
\r
6 fixtures :reference_types, :reference_codes
\r
10 :class => ReferenceType,
\r
11 :primary_keys => :reference_type_id,
\r
14 :class => ReferenceCode,
\r
15 :primary_keys => [:reference_type_id, :reference_code],
\r
20 self.class.classes = CLASSES
\r
25 clone = @first.clone
\r
26 assert_equal @first.attributes.block(@klass.primary_key), clone.attributes
\r
28 @klass.primary_key.each {|key| assert_nil clone[key], "Primary key '#{key}' should be nil"}
\r
30 assert_nil clone[@klass.primary_key], "Sole primary key should be nil"
\r