-# setup()
-can_ok($driver_class => 'setup');
-my $handler = $driver_class->can('handler');
-is($handler, Maypole->can('handler'), 'calling package inherits handler()');
-$driver_class->setup('dbi:foo'); # call setup()
-isnt($handler, $driver_class->can('handler'), 'setup() installs new handler()');
-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');
-$@ = undef; $driver_class->config->model($model_class);
+
+# 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);
+}