Commit | Line | Data |
e60dc79f |
1 | #!/usr/bin/perl -w |
2 | |
3 | use strict; |
4 | use Test::More; |
4c9f72c1 |
5 | use Test::Exception; |
e60dc79f |
6 | |
7 | BEGIN { |
8 | eval "use DBIx::Class::CDBICompat;"; |
9 | plan skip_all => "Class::Trigger and DBIx::ContextualFetch required: $@" |
10 | if $@; |
11 | plan skip_all => "DateTime required" unless eval { require DateTime }; |
12 | plan tests => 1; |
13 | } |
14 | |
15 | { |
16 | package Thing; |
17 | |
18 | use base 'DBIx::Class::Test::SQLite'; |
19 | |
20 | Thing->columns(All => qw[thing_id this that date]); |
21 | } |
22 | |
23 | my $thing = Thing->construct({ thing_id => 23, date => "01-02-1994" }); |
4c9f72c1 |
24 | my $date = DateTime->now; |
25 | lives_ok { |
26 | $thing->set( date => $date ); |
27 | $thing->set( date => $date ); |
e60dc79f |
28 | }; |
4c9f72c1 |
29 | |
30 | |
e60dc79f |
31 | |
32 | $thing->discard_changes; |