[pkg-perl-tools] 01/01: t/github.t: add basic tests for GitHub API

Alex Muntada alexm-guest at moszumanska.debian.org
Sat May 28 13:25:06 UTC 2016


This is an automated email from the git hooks/post-receive script.

alexm-guest pushed a commit to branch master
in repository pkg-perl-tools.

commit c41e6b7b605f63026976681f28eb4f2e36aa4980
Author: Alex Muntada <alexm at alexm.org>
Date:   Sat May 28 13:56:34 2016 +0200

    t/github.t: add basic tests for GitHub API
---
 debian/copyright |  4 ++++
 t/github.t       | 22 ++++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/debian/copyright b/debian/copyright
index 696b983..0b9d37c 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -178,6 +178,10 @@ Copyright: 2013, Damyan Ivanov <dmn at debian.org>
            2013, Axel Beckert <abe at debian.org>
 License: Artistic or GPL-1+
 
+File: t/github.t
+Copyright: 2016, Alex Muntada <alexm at alexm.org>
+License: Artistic or GPL-1+
+
 License: Artistic
  This package is free software; you can redistribute it and/or modify it
  under the terms of the Artistic License.
diff --git a/t/github.t b/t/github.t
new file mode 100644
index 0000000..6f49518
--- /dev/null
+++ b/t/github.t
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+BEGIN {
+    plan skip_all
+        => "GitHub tests require DPT_GITHUB_OAUTH token and Net::GitHub"
+        unless $ENV{DPT_GITHUB_OAUTH} =~ /^\w+$/
+        and eval "use Net::GitHub; 1";
+}
+
+my $gh = new_ok('Net::GitHub::V3', [
+    access_token => $ENV{DPT_GITHUB_OAUTH},
+]);
+
+my $login = 'debian-perl';
+is( $gh->user->show($login)->{login}, $login, $login );
+
+done_testing();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/pkg-perl-tools.git



More information about the Pkg-perl-cvs-commits mailing list