Sha256: 84aa0de336c638cd032b416b39d00b0f3911812b7536644c1bc93dc4607a61d7
Contents?: true
Size: 895 Bytes
Versions: 7
Compression:
Stored size: 895 Bytes
Contents
require 'abstract_unit' require 'fixtures/reference_type' require 'fixtures/reference_code' class TestClone < Test::Unit::TestCase CLASSES = { :single => { :class => ReferenceType, :primary_keys => :reference_type_id, }, :dual => { :class => ReferenceCode, :primary_keys => [:reference_type_id, :reference_code], }, } def setup create_fixtures :reference_types, :reference_codes 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
Version data entries
7 entries across 7 versions & 1 rubygems