File: author-err.t

package info (click to toggle)
libgit-wrapper-perl 0.037-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 232 kB
  • ctags: 55
  • sloc: perl: 451; makefile: 6
file content (52 lines) | stat: -rw-r--r-- 1,301 bytes parent folder | download | duplicates (2)
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

BEGIN {
  unless ($ENV{AUTHOR_TESTING}) {
    require Test::More;
    Test::More::plan(skip_all => 'these tests are for testing by the author');
  }
}

use strict;
use warnings;
use Test::More;

use File::Temp qw(tempdir);
use Git::Wrapper;

my $dir = tempdir(CLEANUP => 1);
my $git = Git::Wrapper->new($dir);

$git->init;

$git->config( 'user.name'  , 'Test User'        );
$git->config( 'user.email' , 'test@example.com' );

## test ->ERR, ->OUT

# this is an author test because I don't think github would appreciate
# everybody pulling this remote every time this module gets installed. Plus I
# don't think people want to wait for it happen. So, author test. Hopefully
# that's sufficient, it's a fairly simple bit of code.

{
  my @out = $git->remote( 'add' , 'test' , 'https://genehack@github.com/genehack/Git-Wrapper.git' );

  my $err = $git->ERR;
  is( ref $err , 'ARRAY' , 'get arrayref' );
  is_deeply( $err , [] , 'nothing on err' );

  is_deeply( \@out , [] , 'nothing on out' );
}

{
  my @out = $git->remote({ 'verbose' => 1 } , 'update' );

  my $err = $git->ERR;
  is( ref $err , 'ARRAY' , 'get arrayref' );
  like( $err->[0] , qr/POST git-upload-pack/ , 'expected content' );

  my $alt_out = $git->OUT;
  is_deeply( \@out , $alt_out , 'outputs are the same' );
}

done_testing();