+# Tests 15 - 21
+warn "Tests 15 to 21\n\n";
+# setup
+{
+ # 2.11 - removed tests to check the installed handler was a different ref after setup().
+ # The handler tests were testing Maypole's old (pre 2.11) method of importing handler()
+ # into the subclass - it works via standard inheritance now, by setting the 'method'
+ # attribute on Maypole::handler(). The reason the handlers were different
+ # was because setup() would create a new anonymous ref to Maypole::handler(), and install
+ # that - i.e. it installed the same code, but in a different ref, so they tested unequal
+ # although they referred to the same code
+
+ $driver_class->setup('dbi:foo');
+
+ ok($required{$model_class}, '... requires model class');
+ is($driver_class->config->model(),
+ 'Maypole::Model::CDBI', '... default model is CDBI');
+ is(@db_args, 1, '... calls model->setup_database');
+ like(join (' ', @{$db_args[0]}),
+ qr/$model_class Maypole::Config=\S* $driver_class dbi:foo/,
+ '... setup_database passed setup() args');
+ is(@adopted, 2, '... calls model->adopt foreach class in the model');
+ ok($adopted[0][0]->isa($model_class),
+ '... sets up model subclasses to inherit from model');
+ $driver_class->config->model('NonExistant::Model');
+ eval {$driver_class->setup};
+ like($@, qr/Couldn't load the model class/,
+ '... dies if unable to load model class');
+
+ # cleanup
+ $@ = undef;
+ $driver_class->config->model($model_class);
+}
+
+
+# Tests 22 - 27
+warn "Tests 22 to 27\n\n";