Quieter replicated test
[dbsrgits/DBIx-Class.git] / t / row / pkless.t
CommitLineData
cf856357 1use strict;
2use warnings;
3
4use Test::More;
5use Test::Exception;
6
7use lib qw(t/lib);
8use DBICTest;
9
10my $schema = DBICTest->init_schema();
11
12my $rs = $schema->resultset('NoPrimaryKey');
13
14my $row = $rs->create ({ foo => 1, bar => 1, baz => 1 });
15
16lives_ok (sub {
17 $row->foo (2);
18}, 'Set on pkless object works');
19
20is ($row->foo, 2, 'Column updated in-object');
21
22dies_ok (sub {
23 $row->update ({baz => 3});
24}, 'update() fails on pk-less object');
25
26is ($row->foo, 2, 'Column not updated by failed update()');
27
28dies_ok (sub {
29 $row->delete;
30}, 'delete() fails on pk-less object');
31
32done_testing;