Add uploads.t
[umph.git] / t / uploads.t
blobd7766e6c56a5b503cb408cfa440e67e62fc36b29
1 # umph
2 # Copyright (C) 2012  Toni Gundogdu <legatvs@cpan.org>
4 # This file is part of umph <http://umph.googlecode.com/>.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 use warnings;
20 use strict;
22 use Test::More;
23 plan skip_all => 'Define TEST_INTERNET to enable' unless $ENV{TEST_INTERNET};
25 eval 'use LWP::UserAgent';
26 plan skip_all => 'LWP::UserAgent required for tests' if $@;
28 eval 'use XML::DOM';
29 plan skip_all => 'XML::DOM required for tests' if $@;;
31 eval 'use Getopt::ArgvFile';
32 plan skip_all => 'Getopt::ArgvFile required for tests' if $@;;
34 my $c = "$ENV{HOME}/.umphrc";
35 diag '~/.umphrc will be read' if -s $c && -r $c;
37 plan tests => 1;
39 my $u = "TwoStepsFromTheMusic";
40 my $C = "perl -I./blib/lib/ blib/script/umph -q -t u 2>&1 $u";
41 note "run: $C";
43 my $o = join '', qx/$C/;
44 my $r = $? >> 8;
46 is($r, 0, "umph exit status == 0")
47   or diag "$u\n$o";