Bug 35248: Add test for Koha::Exceptions::Booking
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
6b8c52104c
commit
8e370de1d9
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
use Modern::Perl;
|
||||
|
||||
use Test::More tests => 11;
|
||||
use Test::More tests => 12;
|
||||
use Test::MockObject;
|
||||
use Test::Exception;
|
||||
|
||||
|
|
@ -337,6 +337,21 @@ subtest 'Koha::Exceptions::Plugin tests' => sub {
|
|||
is( "$@", "Calling 'upgrade' died for plugin $plugin_class", 'Exception stringified correctly' );
|
||||
};
|
||||
|
||||
subtest 'Koha::Exceptions::Booking tests' => sub {
|
||||
|
||||
plan tests => 3;
|
||||
|
||||
use_ok('Koha::Exceptions::Booking');
|
||||
|
||||
throws_ok { Koha::Exceptions::Booking::Clash->throw() }
|
||||
'Koha::Exceptions::Booking::Clash',
|
||||
'Exception is thrown :-D';
|
||||
|
||||
# stringify the exception
|
||||
is( "$@", '[Adding or updating the booking would result in a clash]', 'Exception stringified correctly' );
|
||||
# FIXME: I don't understand why the stringified message here gets wrapped in square brackets...
|
||||
};
|
||||
|
||||
subtest 'Koha::Exception tests' => sub {
|
||||
|
||||
plan tests => 8;
|
||||
|
|
|
|||
Loading…
Reference in New Issue