Remove DateTime requirement from tests that do not rely on it
[dbsrgits/DBIx-Class.git] / t / resultset / create_with_rs_inherited_values.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Test::Exception;
6 use Math::BigInt;
7
8 use lib qw(t/lib);
9 use DBICTest;
10
11 my $schema = DBICTest->init_schema();
12 my $artist_rs = $schema->resultset('Artist');
13 my $cd_rs = $schema->resultset('CD');
14
15  {
16    my $cd;
17    lives_ok {
18      $cd = $cd_rs->search({ year => {'=' => 1999}})->create
19        ({
20          artist => {name => 'Guillermo1'},
21          title => 'Guillermo 1',
22         });
23    };
24    is($cd->year, 1999);
25  }
26
27  {
28    my $dt = Math::BigInt->new(2006);
29
30    my $cd;
31    lives_ok {
32      $cd = $cd_rs->search({ year => $dt})->create
33        ({
34          artist => {name => 'Guillermo2'},
35          title => 'Guillermo 2',
36         });
37    };
38    is($cd->year, 2006);
39  }
40
41
42 {
43   my $artist;
44   lives_ok {
45     $artist = $artist_rs->search({ name => {'!=' => 'Killer'}})
46       ->create({artistid => undef});
47   };
48   is($artist->name, undef);
49 }
50
51
52 {
53   my $artist;
54   lives_ok {
55     $artist = $artist_rs->search({ name => [ qw(some stupid names here) ]})
56       ->create({artistid => undef});
57   };
58   is($artist->name, undef);
59 }
60
61 done_testing;