-require 'abstract_unit'\r
-require 'fixtures/reference_type'\r
-require 'fixtures/reference_code'\r
-\r
-class TestClone < Test::Unit::TestCase\r
- fixtures :reference_types, :reference_codes\r
- \r
- CLASSES = {\r
- :single => {\r
- :class => ReferenceType,\r
- :primary_keys => :reference_type_id,\r
- },\r
- :dual => { \r
- :class => ReferenceCode,\r
- :primary_keys => [:reference_type_id, :reference_code],\r
- },\r
- }\r
- \r
- def setup\r
- self.class.classes = CLASSES\r
- end\r
- \r
- def test_truth\r
- testing_with do\r
- clone = @first.clone\r
- assert_equal @first.attributes.block(@klass.primary_key), clone.attributes\r
- if composite?\r
- @klass.primary_key.each {|key| assert_nil clone[key], "Primary key '#{key}' should be nil"} \r
- else\r
- assert_nil clone[@klass.primary_key], "Sole primary key should be nil"\r
- end\r
- end\r
- end\r
+require 'abstract_unit'
+require 'fixtures/reference_type'
+require 'fixtures/reference_code'
+
+class TestClone < Test::Unit::TestCase
+ fixtures :reference_types, :reference_codes
+
+ CLASSES = {
+ :single => {
+ :class => ReferenceType,
+ :primary_keys => :reference_type_id,
+ },
+ :dual => {
+ :class => ReferenceCode,
+ :primary_keys => [:reference_type_id, :reference_code],
+ },
+ }
+
+ def setup
+ self.class.classes = CLASSES
+ end
+
+ def test_truth
+ testing_with do
+ clone = @first.clone
+ assert_equal @first.attributes.block(@klass.primary_key), clone.attributes
+ if composite?
+ @klass.primary_key.each {|key| assert_nil clone[key], "Primary key '#{key}' should be nil"}
+ else
+ assert_nil clone[@klass.primary_key], "Sole primary key should be nil"
+ end
+ end
+ end
end
\ No newline at end of file