Changeset 104
- Timestamp:
- 05/04/06 00:08:26 (4 years ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
lib/Data/ObjectDriver/BaseObject.pm (modified) (1 diff)
-
t/02-basic.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Data/ObjectDriver/BaseObject.pm
r102 r104 117 117 sub column_values { $_[0]->{'column_values'} } 118 118 119 ## In 0.1 version we didn't die on inexistent column 120 ## which might lead to silent bugs 121 ## You should override column if you want to find the old 122 ## behaviour 119 123 sub column { 120 124 my $obj = shift; 121 125 my $col = shift or return; 126 unless ($obj->has_column($col)) { 127 Carp::croak("Cannot find column '$col' for class '" . ref($obj) . "'"); 128 } 122 129 $obj->{column_values}->{$col} = shift if @_; 123 130 $obj->{column_values}->{$col}; -
trunk/t/02-basic.t
r103 r104 19 19 } 20 20 21 plan tests => 2 2;21 plan tests => 23; 22 22 23 23 use Wine; … … 35 35 ok $w->has_column("name"); 36 36 ok ! $w->has_column("inexistent"); 37 dies_ok { $w->inexistent("hell") } "dies on setting inexistent column"; 37 dies_ok { $w->inexistent("hell") } "dies on setting inexistent column : 'inexistent()'"; 38 dies_ok { $w->column('inexistent') } "dies on setting inexistent column : 'column()'"; 38 39 } 39 40
