Skip to content

Commit

Permalink
more unindent tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 25, 2014
1 parent 912902f commit 2a7e4e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/Util.pm
Expand Up @@ -635,7 +635,7 @@ Trim whitespace characters from both ends of string.
my $unindented = unindent $str;
Unindent multiline text.
Unindent multiline string.
=head2 unquote
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Command.pm
Expand Up @@ -50,8 +50,8 @@ sub create_rel_dir {
sub extract_usage {
my $self = shift;

open my $fh, '>', \my $output;
pod2usage -exitval => 'noexit', -input => (caller)[1], -output => $fh;
open my $handle, '>', \my $output;
pod2usage -exitval => 'noexit', -input => (caller)[1], -output => $handle;
$output =~ s/^.*\n//;
$output =~ s/\n$//;

Expand Down
2 changes: 2 additions & 0 deletions t/mojo/util.t
Expand Up @@ -97,6 +97,8 @@ is unindent(" test\n 123\n 456\n"), "test\n 123\n456\n",
'right unindented result';
is unindent("\ttest\n\t\t123\n\t456\n"), "test\n\t123\n456\n",
'right unindented result';
is unindent("\t \ttest\n\t \t\t123\n\t \t456\n"), "test\n\t123\n456\n",
'right unindented result';
is unindent("\n\n\n test\n 123\n 456\n"), "\n\n\ntest\n 123\n456\n",
'right unindented result';
is unindent(" test\n 123\n 456\n"), "test\n 123\n456\n",
Expand Down

0 comments on commit 2a7e4e1

Please sign in to comment.