Version 0.3
[blog.pm-common-perl-mods.git] / Rose-DB-Object-VCS / t / last-diff.t
blob004b788c316dd68597fc8bbbbc4ed8f7fc093b9d
1 #! /usr/bin/perl
3 use strict;
4 use warnings;
6 use Test::More 'tests' => 2;
8 use lib 't/lib';
10 use NewDB;
11 use Post;
12 use Post::Manager;
14 my $db = NewDB->new();
16 $db->init();
18 my $post = Post->new(
19 user_id => 1,
20 title => 'bu',
21 content => 'how',
22 user_id => 1
24 $post->commit();
26 $post = Post->new(id => $post->id);
27 $post->load();
29 my $diff = $post->last_diff();
31 ok( not defined $diff );
33 $post->title( 'hello' );
34 $post->commit();
36 $diff = $post->last_diff();
38 ok( $diff );
40 $post->delete(cascade => 1);