Bring out the big-paranoia-harness - make describe_env infallible
[dbsrgits/DBIx-Class.git] / t / update / type_aware.t
1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7
8 use DBICTest;
9
10 my $schema = DBICTest->init_schema();
11
12 plan tests => 4;
13
14 my $artist = $schema->resultset ('Artist')->first;
15 ok (!$artist->get_dirty_columns, 'Artist is clean' );
16
17 $artist->rank (13);
18 ok (!$artist->get_dirty_columns, 'Artist is clean after num value update' );
19 $artist->discard_changes;
20
21 $artist->rank ('13.00');
22 ok (!$artist->get_dirty_columns, 'Artist is clean after string value update' );
23 $artist->discard_changes;
24
25 # override column info
26 $artist->result_source->column_info ('rank')->{is_numeric} = 0;
27 $artist->rank ('13.00');
28 ok ($artist->get_dirty_columns, 'Artist is updated after is_numeric override' );
29 $artist->discard_changes;