7
7
require "test_helpers.pl";
9
mock_perlbrew_install("perl-5.12.3");
12
use Test::Output qw(stdout_is stdout_from stdout_like);
14
11
my $bin_perlbrew = file(__FILE__)->dir->parent->subdir("bin")->file("perlbrew");
16
describe "help" => sub {
15
# Doing `App::perlbrew->new("help")->run` will make this test program exit(),
16
# that's why we use backtick to test.
20
describe "`perlbrew`" => sub {
21
it "should print some nice message and instruct user to read help for individual commands" => sub {
22
my $out = `$perl -Ilib $bin_perlbrew help`;
23
like $out, qr/perlbrew help <command>/si;
27
describe "`perlbrew help`" => sub {
17
28
it "should instruct user to read help for individual commands." => sub {
20
29
my $out = `$perl -Ilib $bin_perlbrew help`;
21
30
like $out, qr/perlbrew help <command>/si;
33
it "should be the same as doing `perlbrew -h` or `perlbrew --help`" => sub {
34
my $out1 = `$perl -Ilib $bin_perlbrew help`;
35
my $out2 = `$perl -Ilib $bin_perlbrew -h`;
36
my $out3 = `$perl -Ilib $bin_perlbrew --help`;
42
describe "`help install`" => sub {
43
it "should show the options for install command" => sub {
44
my $out = `$perl -Ilib $bin_perlbrew help install`;
45
like $out, qr/^Options for "install" command:/msi;
46
like $out, qr/--force/si;
47
like $out, qr/--notest/si;
25
51
runtests unless caller;