-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved documentation for sub commands
- Loading branch information
1 parent
0287e18
commit 487f2bd
Showing
2 changed files
with
53 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use strictures 2; | ||
use Test::More; | ||
|
||
my $app = require "./script/opan"; | ||
|
||
my %descriptions = ( | ||
add => qr{Imports a distribution.*MY}, | ||
carton => qr{Starts a temporary server.*carton}, | ||
cpanm => qr{Starts a temporary server process and runs cpanm}, | ||
fetch => qr{Fetches 02packages.*PAN}, | ||
init => qr{Creates a pans/ directory.*}, | ||
merge => qr{Rebuilds the combined and nopin}, | ||
pin => qr{Fetches the file .* pinset}, | ||
pull => qr{Does a fetch and then a merge}, | ||
purge => qr{Deletes all files}, | ||
purgelist => qr{Outputs a list of all non-indexed dists in pinset and custom}, | ||
unadd => qr{custom PAN index[\s\n]+and removes the entries}, | ||
unpin => qr{pinset PAN index[\s\n]+and removes the entries}, | ||
); | ||
|
||
for my $cmd ( | ||
qw(init fetch add unadd pin unpin merge pull purgelist purge cpanm carton) | ||
) { | ||
my $pkg = "App::opan::Command::${cmd}"; | ||
like $pkg->new->usage, qr/^\s+opan $cmd.*$descriptions{$cmd}/s, "$cmd usage"; | ||
like $pkg->new->description, $descriptions{$cmd}, "$cmd description"; | ||
unlike $pkg->new->description, qr{[<>]}, "$cmd description without pod characters"; | ||
} | ||
|
||
done_testing; |