-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #807 from lukec/Test2-start
Start migrating to Test2
- Loading branch information
Showing
50 changed files
with
435 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
#!/usr/bin/env perl | ||
use Test2::V0; | ||
use strict; | ||
use Test::More tests => 1; | ||
use lib qw(lib); | ||
|
||
use_ok('App::perlbrew'); | ||
plan 1; | ||
|
||
use ok 'App::perlbrew'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
#!perl | ||
use strict; | ||
use Test::More tests => 12; | ||
use Test2::V0; | ||
use Data::Dumper; | ||
|
||
use App::perlbrew; | ||
|
||
my $app = App::perlbrew->new('install', '-n', 'perl-5.12.1', | ||
'-Dusethreads', '-DDEBUGGING', '-Uusemymalloc', '-Accflags'); | ||
|
||
note explain($app) | ||
if (main->can('note') && main->can('explain')); | ||
note Dumper($app); | ||
|
||
is join(' ', $app->args), join(' ', qw(install perl-5.12.1)); | ||
|
||
is_deeply $app->{D}, [qw(usethreads DEBUGGING)], '-D'; | ||
is_deeply $app->{U}, [qw(usemymalloc)], '-U'; | ||
is_deeply $app->{A}, [qw(ccflags)], '-A'; | ||
is $app->{D}, [qw(usethreads DEBUGGING)], '-D'; | ||
is $app->{U}, [qw(usemymalloc)], '-U'; | ||
is $app->{A}, [qw(ccflags)], '-A'; | ||
|
||
ok !$app->{quiet}, 'not quiet'; | ||
ok $app->{notest}, 'notest'; | ||
|
||
$app = App::perlbrew->new('install', '--quiet', 'perl-5.12.1', | ||
'-D', 'usethreads', '-D=DEBUGGING', '-U', 'usemymalloc', '-A', 'ccflags'); | ||
|
||
note explain($app) | ||
if (main->can('note') && main->can('explain')); | ||
note Dumper($app); | ||
|
||
is join(' ', $app->args), join(' ', qw(install perl-5.12.1)); | ||
|
||
is_deeply $app->{D}, [qw(usethreads DEBUGGING)], '-D'; | ||
is_deeply $app->{U}, [qw(usemymalloc)], '-U'; | ||
is_deeply $app->{A}, [qw(ccflags)], '-A'; | ||
is $app->{D}, [qw(usethreads DEBUGGING)], '-D'; | ||
is $app->{U}, [qw(usemymalloc)], '-U'; | ||
is $app->{A}, [qw(ccflags)], '-A'; | ||
|
||
ok $app->{quiet}, 'quiet'; | ||
ok !$app->{notest}, 'notest'; | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
#!/usr/bin/env perl | ||
use strict; | ||
use warnings; | ||
use Test::More; | ||
use Test2::V0; | ||
use App::perlbrew; | ||
|
||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
#!/usr/bin/env perl | ||
use strict; | ||
use warnings; | ||
use Test2::V0; | ||
|
||
use App::perlbrew; | ||
use Test::More; | ||
use Test::Exception; | ||
|
||
no warnings 'redefine'; | ||
sub App::perlbrew::http_get { "" } | ||
|
||
throws_ok( | ||
sub { | ||
like( | ||
dies { | ||
my $app = App::perlbrew->new("available"); | ||
$app->run; | ||
}, | ||
qr[ERROR:] | ||
qr[ERROR:], | ||
'got Error from available' | ||
); | ||
|
||
throws_ok( | ||
sub { | ||
like( | ||
dies { | ||
my $app = App::perlbrew->new("available"); | ||
my $ret = $app->available_perl_distributions(); | ||
}, | ||
qr[ERROR:] | ||
qr[ERROR:], | ||
'got Error from available_perl_distributions' | ||
); | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
#!/usr/bin/env perl | ||
use strict; | ||
use warnings; | ||
use Test2::V0; | ||
|
||
use FindBin; | ||
use lib $FindBin::Bin; | ||
use App::perlbrew; | ||
require 'test_helpers.pl'; | ||
|
||
use Test::More; | ||
use Test::Exception; | ||
require 'test2_helpers.pl'; | ||
|
||
use App::perlbrew; | ||
{ | ||
no warnings 'redefine'; | ||
sub App::perlbrew::http_download { return "ERROR" } | ||
} | ||
|
||
throws_ok( | ||
sub { | ||
like( | ||
dies { | ||
my $app = App::perlbrew->new("install", "perl-blead"); | ||
$app->run; | ||
}, | ||
qr[ERROR: Failed to download https://.+/blead\.tar\.gz] | ||
qr[ERROR: Failed to download https://.+/blead\.tar\.gz], | ||
'install blead-perl failed' | ||
); | ||
|
||
throws_ok( | ||
sub { | ||
like( | ||
dies { | ||
my $app = App::perlbrew->new("install", "blead"); | ||
$app->run; | ||
}, | ||
qr[ERROR: Failed to download https://.+/blead\.tar\.gz] | ||
qr[ERROR: Failed to download https://.+/blead\.tar\.gz], | ||
'install blead failed' | ||
); | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.