}
-# validate_inputs undocumented. It is not yet part of the public interface.
-#=head2 validate_inputs
-#
-#$self->validate_inputs($h, $opts);
-#
-#This is the main validation method to validate inputs for a single class.
-#Most of the time you use validate_all.
-#
-# Returns validated and errors.
-# If no errors then undef in that slot.
-#
-#=cut
+
+=head2 validate_inputs
+
+$self->validate_inputs($h, $opts);
+
+This is the main validation method to validate inputs for a single class.
+Most of the time you use validate_all.
+
+Returns validated and errors.
+
+If no errors then undef in that slot.
+
+Note: This method is currently experimental (in 2.11) and may be subject to change
+without notice.
+
+=cut
sub validate_inputs {
my ($self, $h, $opts) = @_;
created => 'CURRENT_TIMESTAMP',
modified => undef,
style => 1,
- name => 'noname',
+ name => 'noname',
);
# correct nullables
brewery => 1,
modified => 1,
style => 0,
- name => 0,
+ name => 0,
tasted => 0,
);
sub run_method_tests {
($class, $method, %correct) = @_;
for $col (sort keys %correct) {
+# warn "class : $class\n";
+# warn "ISA : ", join(', ',@BeerDB::BeerTestmysql::ISA);
$val = $class->$method($col);
# Hacks for various val types
skip $skip_msg, $skip_howmany if $err;
$DB_Class->db_Main->do("drop table if exists $table;");
$DB_Class->db_Main->do($sql);
- $DB_Class->table($table);
+ $DB_Class->table($table);
run_method_tests($DB_Class,'column_type', %correct_types);
run_method_tests($DB_Class,'column_default', %correct_defaults);
run_method_tests($DB_Class,'column_nullable', %correct_nullables);
package BeerDB::BeerTestsqlite;
use base Maypole::Model::CDBI;
package main;
+use Cwd;
$DB_Class = 'BeerDB::BeerTestsqlite';
}
unless ($err) {
my $driver = sqlite_driver();
- eval { $DB_Class->connection("dbi:$driver:dbname='t/test.db'");};
+ warn "using driver : $driver";
+ my $cwd = cwd;
+ eval { $DB_Class->connection("dbi:$driver:dbname=$cwd/t/test.db");};
$err = $@;
}