788B; Perl | 2018-07-19 14:53:12+02 | Statements 26 | SLOC 29
1
#!/usr/bin/env perl
2
3
use strict;
4
use warnings;
5
use WWW::RT::CPAN;	# FIXME: use a REST client
6
use Data::Dumper;
7
use Test::Most tests => 3;
8
9
NOBUGS: {
10
	SKIP: {
11
		if($ENV{AUTHOR_TESTING}) {
12
			if(my @rc = @{WWW::RT::CPAN::list_dist_active_tickets(dist => 'CGI-Buffer')}) {
13
				ok($rc[0] == 200);
14
				ok($rc[1] eq 'OK');
15
				my @tickets = @{$rc[2]};
16
17
				if(scalar(@tickets)) {
18 1
					foreach my $ticket(@tickets) {
19
						diag($ticket->{id}, ': ', $ticket->{title}, ', broken since ', $ticket->{'broken_in'}[0]);
20
					}
21
				}
22
				ok(scalar(@tickets) == 0);
23
			} else {
24
				diag("Can't connect to rt.cpan.org");
25
				skip("Can't connect to rt.cpan.org", 3);
26
			}
27
		} else {
28
			diag('Author tests not required for installation');
29
			skip('Author tests not required for installation', 3);
30
		}
31
	}
32
}