X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi-t%2F04-lazy.t;h=5fd18f2c1a819b4049c3cd4d32759af6a2df9f4e;hb=c0fcc63f9a95819d353c5640ad2cc8d2b956ad63;hp=69b3549f6aa90a7f0f408c1b208e0fa42faa73c1;hpb=1c779eb2212fac3c44e615418c2b516e18cbc5e2;p=dbsrgits%2FDBIx-Class.git diff --git a/t/cdbi-t/04-lazy.t b/t/cdbi-t/04-lazy.t index 69b3549..5fd18f2 100644 --- a/t/cdbi-t/04-lazy.t +++ b/t/cdbi-t/04-lazy.t @@ -13,7 +13,7 @@ BEGIN { next; } eval "use DBD::SQLite"; - plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 25); + plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 27); } INIT { @@ -79,3 +79,24 @@ eval { # Multiple false columns }; ok($@, $@); + +# Test that update() throws out columns that changed +{ + my $l = Lazy->create({ + this => 99, + that => 2, + oop => 3, + opop => 4, + }); + + $l->oop(32); + $l->update; + + ok $l->db_Main->do(qq{ + UPDATE @{[ $l->table ]} + SET oop = ? + WHERE this = ? + }, undef, 23, $l->this); + + is $l->oop, 23; +}