Skip to content

Commit

Permalink
test localized Getopt::Long configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 26, 2013
1 parent d549c7f commit 7af0b1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions t/mojolicious/app.t
Expand Up @@ -48,6 +48,9 @@ is $t->app->static->file('hello.txt')->slurp,
"Hello Mojo from a development static file!\n", 'right content';
is $t->app->moniker, 'mojolicious_test', 'right moniker';

# MojoliciousTest::Command::test_command (with abbreviation)
is $t->app->start(qw(test_command --to)), 'works too!', 'right result';

# Plugin::Test::SomePlugin2::register (security violation)
$t->get_ok('/plugin-test-some_plugin2/register')->status_isnt(500)
->status_is(404)->header_is(Server => 'Mojolicious (Perl)')
Expand Down
8 changes: 7 additions & 1 deletion t/mojolicious/lib/MojoliciousTest/Command/test_command.pm
@@ -1,6 +1,12 @@
package MojoliciousTest::Command::test_command;
use Mojo::Base 'Mojolicious::Command';

sub run { return 'works!' }
use Getopt::Long 'GetOptionsFromArray';

sub run {
my ($self, @args) = @_;
GetOptionsFromArray \@args, 'too' => \my $too;
return $too ? 'works too!' : 'works!';
}

1;

0 comments on commit 7af0b1f

Please sign in to comment.