|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 11; |
20 |
use Test::More tests => 12; |
| 21 |
use Test::MockObject; |
21 |
use Test::MockObject; |
| 22 |
use Test::Exception; |
22 |
use Test::Exception; |
| 23 |
|
23 |
|
|
Lines 337-342
subtest 'Koha::Exceptions::Plugin tests' => sub {
Link Here
|
| 337 |
is( "$@", "Calling 'upgrade' died for plugin $plugin_class", 'Exception stringified correctly' ); |
337 |
is( "$@", "Calling 'upgrade' died for plugin $plugin_class", 'Exception stringified correctly' ); |
| 338 |
}; |
338 |
}; |
| 339 |
|
339 |
|
|
|
340 |
subtest 'Koha::Exceptions::Booking tests' => sub { |
| 341 |
|
| 342 |
plan tests => 3; |
| 343 |
|
| 344 |
use_ok('Koha::Exceptions::Booking'); |
| 345 |
|
| 346 |
throws_ok { Koha::Exceptions::Booking::Clash->throw() } |
| 347 |
'Koha::Exceptions::Booking::Clash', |
| 348 |
'Exception is thrown :-D'; |
| 349 |
|
| 350 |
# stringify the exception |
| 351 |
is( "$@", '[Adding or updating the booking would result in a clash]', 'Exception stringified correctly' ); |
| 352 |
# FIXME: I don't understand why the stringified message here gets wrapped in square brackets... |
| 353 |
}; |
| 354 |
|
| 340 |
subtest 'Koha::Exception tests' => sub { |
355 |
subtest 'Koha::Exception tests' => sub { |
| 341 |
|
356 |
|
| 342 |
plan tests => 8; |
357 |
plan tests => 8; |
| 343 |
- |
|
|