Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
more environment detection tests
  • Loading branch information
kraih committed Jan 14, 2015
1 parent 5f39e3d commit 181a9e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Mojolicious/Commands.pm
Expand Up @@ -299,7 +299,7 @@ implements the following new ones.
my $env = $commands->detect;
Try to detect environment.
Try to detect environment or return C<undef> if none could be detected.
=head2 run
Expand Down
4 changes: 4 additions & 0 deletions t/mojolicious/commands.t
Expand Up @@ -33,6 +33,10 @@ my $commands = Mojolicious::Commands->new;
local $ENV{GATEWAY_INTERFACE} = 'CGI/1.1';
is $commands->detect, 'cgi', 'right environment';
}
{
local @ENV{qw(PLACK_ENV PATH_INFO GATEWAY_INTERFACE)};
is $commands->detect, undef, 'no environment';
}

# Run command
is ref Mojolicious::Commands->new->run('psgi'), 'CODE', 'right reference';
Expand Down

0 comments on commit 181a9e2

Please sign in to comment.