X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/3e67d08c13b391e3d5d88280713e97caf9a8c36d..a36185b22f32f8053a6c1bd98bd751f24353a95f:/vendor/gems/composite_primary_keys-2.2.2/test/test_clone.rb diff --git a/vendor/gems/composite_primary_keys-2.2.2/test/test_clone.rb b/vendor/gems/composite_primary_keys-2.2.2/test/test_clone.rb index 822974430..26e7970d5 100644 --- a/vendor/gems/composite_primary_keys-2.2.2/test/test_clone.rb +++ b/vendor/gems/composite_primary_keys-2.2.2/test/test_clone.rb @@ -1,34 +1,34 @@ -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 +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