File: 200-repos.t

package info (click to toggle)
libnet-github-perl 1.05-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 376 kB
  • sloc: perl: 2,073; makefile: 8
file content (52 lines) | stat: -rw-r--r-- 946 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env perl

use strict;
use warnings;
use Test::More;
use Net::GitHub::V3;

my $gh = Net::GitHub::V3->new;
my $repos = $gh->repos;

ok( $gh );
ok( $repos );

my @p = $repos->list_user('fayland');
cmp_ok(@p, ">", 3, 'more than 3 repos');

my $rp = $repos->get('fayland', 'perl-net-github');
is $rp->{name},         "perl-net-github";
is $rp->{owner}{login}, "fayland" or diag explain $rp;


=pod

$repos->set_default_user_repo('fayland', 'perl-net-github');
my @commits = $repos->commits({
    author => 'jibsheet'
});
use Data::Dumper;
print Dumper(\@commits);

=cut

=pod

$repos->set_default_user_repo('fayland', 'perl-net-github');
my $hook = $repos->create_hook( {
  "name" => "web",
  "active" => 'true',
  "config" => {
    "url" => "http://something.com/webhook"
  }
} );
use Data::Dumper;
diag(Dumper(\$hook));
my @hooks = $repos->hooks;
is(@hooks, 1);
my $st = $repos->delete_hook($hook->{id});
is($st, 1);

=cut

done_testing;