From: Moritz Onken Date: Thu, 10 Sep 2009 16:53:32 +0000 (+0000) Subject: added test to make sure that store_column is called even for non-dirty columns X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a22688ab3069992b58dbd64d2b62a76744873a00;p=dbsrgits%2FDBIx-Class-Historic.git added test to make sure that store_column is called even for non-dirty columns --- diff --git a/t/60core.t b/t/60core.t index 24b001f..6094c39 100644 --- a/t/60core.t +++ b/t/60core.t @@ -108,6 +108,10 @@ is($new_again->ID, 'DBICTest::Artist|artist|artistid=4', 'unique object id gener { ok(my $artist = $schema->resultset('Artist')->create({name => 'store_column test'})); is($artist->name, 'X store_column test'); # used to be 'X X store...' + + # call store_column even though the column doesn't seem to be dirty + ok($artist->update({name => 'X store_column test'})); + is($artist->name, 'X X store_column test'); $artist->delete; } diff --git a/t/lib/DBICTest/Schema/Artist.pm b/t/lib/DBICTest/Schema/Artist.pm index 56c1191..2b4b42c 100644 --- a/t/lib/DBICTest/Schema/Artist.pm +++ b/t/lib/DBICTest/Schema/Artist.pm @@ -71,7 +71,7 @@ sub sqlt_deploy_hook { sub store_column { my ($self, $name, $value) = @_; - $value = 'X '.$value if ($name eq 'name' && $value && $value =~ /store_column test/); + $value = 'X '.$value if ($name eq 'name' && $value && $value =~ /(X )?store_column test/); $self->next::method($name, $value); }