Merge 'trunk' into 'DBIx-Class-current'
[dbsrgits/DBIx-Class-Historic.git] / t / run / 09update.tl
1 sub run_tests {
2 my $schema = shift;
3
4 BEGIN {
5         eval "use DBD::SQLite";
6         plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 3);
7 }                                                                               
8
9 my $art = $schema->resultset("Artist")->find(1);
10
11 isa_ok $art => 'DBICTest::Artist';
12
13 my $name = 'Caterwauler McCrae';
14
15 ok($art->name($name) eq $name, 'update');
16
17
18   my @changed_keys = $art->is_changed;
19   is( scalar (@changed_keys), 0, 'field changed but same value' );
20 }                                                                               
21
22 $art->discard_changes;
23
24 }
25
26 1;