Todo tests for txn_rollback and scope_guard
[dbsrgits/DBIx-Class.git] / t / 84serialize.t
1 use strict;
2 use warnings;  
3
4 use Test::More;
5 use lib qw(t/lib);
6 use DBICTest;
7 use Storable;
8
9 my $schema = DBICTest->init_schema();
10
11 plan tests => 6;
12
13 my $artist = $schema->resultset('Artist')->find(1);
14
15 {
16   my $copy = $schema->dclone($artist);
17   is_deeply($copy, $artist, "dclone row object works");
18   eval { $copy->discard_changes };
19   ok( !$@, "discard_changes okay" );
20   is($copy->id, $artist->id, "IDs still match ");
21 }
22
23 {
24   my $ice = $schema->freeze($artist);
25   my $copy = $schema->thaw($ice);
26   is_deeply($copy, $artist, 'dclone row object works');
27
28   eval { $copy->discard_changes };
29   ok( !$@, "discard_changes okay" );
30   is($copy->id, $artist->id, "IDs still okay");
31 }
32