GitHub-Apps-Auth

 view release on metacpan or  search on metacpan

t/04_installations.t  view on Meta::CPAN

use strict;
use Test::More;
use Test::Mock::Guard;

use GitHub::Apps::Auth;
use Crypt::PK::RSA;

my $pk = Crypt::PK::RSA->new->generate_key->export_key_pem("private");

my $g = mock_guard "GitHub::Apps::Auth" => {
    installations => sub {
        return {
            foobar => 4242,
        },
    },
};

my $auth = GitHub::Apps::Auth->new(
    private_key => \$pk,
    app_id => 42,
    login => "foobar",
);

is $auth->installation_id, 4242;

done_testing;



( run in 0.910 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )