Skip to content

Commit

Permalink
added AUTOLOAD tests for Mojolicious::Validator::Validation
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 30, 2013
1 parent 905eec3 commit 601be47
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions t/mojolicious/validation_lite_app.t
Expand Up @@ -148,6 +148,14 @@ ok $validation->has_error, 'has error';
is_deeply [$validation->errors('foo')->each], ['Value is required.'],
'right error';

# Missing method and function (AUTOLOAD)
eval { $t->app->validation->missing };
my $package = 'Mojolicious::Validator::Validation';
like $@, qr/^Can't locate object method "missing" via package "$package"/,
'right error';
eval { Mojolicious::Validator::Validation::missing() };
like $@, qr/^Undefined subroutine &${package}::missing called/, 'right error';

# No validation
$t->get_ok('/')->status_is(200)->element_exists_not('div:root')
->text_is('label[for="foo"]' => '<Foo>')
Expand Down

0 comments on commit 601be47

Please sign in to comment.