~ubuntu-branches/debian/sid/perlbrew/sid

« back to all changes in this revision

Viewing changes to t/command-help.t

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini, Salvatore Bonaccorso, gregor herrmann, Alessandro Ghedini
  • Date: 2014-04-27 17:07:29 UTC
  • mfrom: (1.1.31)
  • Revision ID: package-import@ubuntu.com-20140427170729-xwed18u1gubryh05
Tags: 0.67-1
[ Salvatore Bonaccorso ]
* Imported Upstream version 0.67 (Closes: #746138)
* Update versioned (Build-)Depends(-Indep) for liblocal-lib-perl.
  Update the versioned Build-Depends-Indep and Depends on
  liblocal-lib-perl to (>= 1.008026).
* Bump Standards-Version to 3.9.5

[ gregor herrmann ]
* Strip trailing slash from metacpan URLs.

[ Alessandro Ghedini ]
* Add 01_fix-spelling.patch to fix spelling-error-in-manpage
* Add 02_fix-pod.patch to fix manpage-has-errors-from-pod2man

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
use App::perlbrew;
7
7
require "test_helpers.pl";
8
8
 
9
 
mock_perlbrew_install("perl-5.12.3");
10
 
 
11
9
use Test::Spec;
12
 
use Test::Output qw(stdout_is stdout_from stdout_like);
13
10
 
14
11
my $bin_perlbrew = file(__FILE__)->dir->parent->subdir("bin")->file("perlbrew");
15
 
 
16
 
describe "help" => sub {
 
12
my $perl = $^X;
 
13
 
 
14
#
 
15
# Doing `App::perlbrew->new("help")->run` will make this test program exit(),
 
16
# that's why we use backtick to test.
 
17
#
 
18
 
 
19
 
 
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;
 
24
    };
 
25
};
 
26
 
 
27
describe "`perlbrew help`" => sub {
17
28
    it "should instruct user to read help for individual commands." => sub {
18
 
        my $perl = $^X;
19
 
 
20
29
        my $out = `$perl -Ilib $bin_perlbrew help`;
21
30
        like $out, qr/perlbrew help <command>/si;
22
31
    };
 
32
 
 
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`;
 
37
        is $out1, $out2;
 
38
        is $out1, $out3;
 
39
    };
 
40
};
 
41
 
 
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;
 
48
    };
23
49
};
24
50
 
25
51
runtests unless caller;