CGI-Application-Plugin-OpenTracing-DataDog

 view release on metacpan or  search on metacpan

t/00_use_ok.t  view on Meta::CPAN

use Test::Most;

use strict;
use warnings;

use Ref::Util qw/is_coderef/;

# we could check that we actually add the callbacks ? that is what `use` is
# suposed to do, we opught to test that here!!
#

my $callbacks = [];
sub add_callback { push @$callbacks, +{ name=> $_[1], coderef =>  $_[2] } };

BEGIN {
    use_ok('CGI::Application::Plugin::OpenTracing::DataDog');
    
    cmp_deeply( $callbacks =>
        [
            {
                name    => 'init',
                coderef => code( \&is_coderef ),
            },
            {
                name    => 'prerun',
                coderef => code( \&is_coderef ),
            },
            {

t/00_use_ok.t  view on Meta::CPAN

            },
            {
                name    => 'teardown',
                coderef => code( \&is_coderef ),
            },
            {
                name    => 'error',
                coderef => code( \&is_coderef ),
            },
        ],
        "Installed expected callbacks, and these are coderefs!"
    );
    
};

done_testing;



( run in 1.012 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )