Tests: restructure to more closely mirror the sources
t/ had lots of directories and files mirroring src/lib/Hydra. This moves those files under t/Hydra
This commit is contained in:
23
t/Hydra/Event.t
Normal file
23
t/Hydra/Event.t
Normal file
@ -0,0 +1,23 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Hydra::Event;
|
||||
|
||||
use Test2::V0;
|
||||
use Test2::Tools::Exception;
|
||||
|
||||
subtest "Event: new event" => sub {
|
||||
my $event = Hydra::Event->new_event("build_started", "19");
|
||||
is($event->{'payload'}, "19");
|
||||
is($event->{'channel_name'}, "build_started");
|
||||
is($event->{'event'}->{'build_id'}, 19);
|
||||
};
|
||||
|
||||
subtest "Payload type: bogus" => sub {
|
||||
like(
|
||||
dies { Hydra::Event::parse_payload("bogus", "") },
|
||||
qr/Invalid channel name/,
|
||||
"bogus channel"
|
||||
);
|
||||
};
|
||||
|
||||
done_testing;
|
Reference in New Issue
Block a user