Introduce GOVERNANCE document and empty RESOLUTIONS file.
[dbsrgits/DBIx-Class.git] / t / resultset / create_with_rs_inherited_values.t
CommitLineData
c0329273 1BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
561f003c 3use strict;
4use warnings;
5
c959e8d0 6use Test::More;
68de9438 7use Test::Exception;
1f5d74ae 8use Math::BigInt;
68de9438 9
c0329273 10
4bea1fe7 11use DBICTest;
12
561f003c 13my $schema = DBICTest->init_schema();
14my $artist_rs = $schema->resultset('Artist');
15my $cd_rs = $schema->resultset('CD');
16
17 {
18 my $cd;
19 lives_ok {
20 $cd = $cd_rs->search({ year => {'=' => 1999}})->create
21 ({
22 artist => {name => 'Guillermo1'},
23 title => 'Guillermo 1',
24 });
25 };
26 is($cd->year, 1999);
27 }
28
29 {
1f5d74ae 30 my $dt = Math::BigInt->new(2006);
31
561f003c 32 my $cd;
33 lives_ok {
34 $cd = $cd_rs->search({ year => $dt})->create
35 ({
36 artist => {name => 'Guillermo2'},
37 title => 'Guillermo 2',
38 });
39 };
40 is($cd->year, 2006);
41 }
42
43
44{
45 my $artist;
46 lives_ok {
47 $artist = $artist_rs->search({ name => {'!=' => 'Killer'}})
48 ->create({artistid => undef});
49 };
50 is($artist->name, undef);
51}
52
53
54{
55 my $artist;
56 lives_ok {
1de54066 57 $artist = $artist_rs->search({ name => [ qw(some stupid names here) ]})
561f003c 58 ->create({artistid => undef});
59 };
60 is($artist->name, undef);
61}
62
89bddb49 63done_testing;