Skip to content

Commit

Permalink
more tests for verbose exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 26, 2016
1 parent 3f6f1ec commit 5ae4a30
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions t/mojo/exception.t
Expand Up @@ -73,13 +73,19 @@ is_deeply $e->line, [4, 'use Mojo::Exception;'], 'right line';
is_deeply $e->lines_after->[0], [5, ''], 'right line';

# Verbose
$e = Mojo::Exception->new('Test!')->lines_before([[3, 'foo();']])
->line([4, 'die;'])->lines_after([[5, 'bar();']])->verbose(1);
$e = Mojo::Exception->new('Test!')->verbose(1);
$e->lines_before([[3, 'foo();']])->line([4, 'die;'])
->lines_after([[5, 'bar();']]);
is $e, <<EOF, 'right result';
Test!
3: foo();
4: die;
5: bar();
EOF
$e->message("Works!\n")->lines_before([])->lines_after([]);
is $e, <<EOF, 'right result';
Works!
4: die;
EOF

done_testing();

0 comments on commit 5ae4a30

Please sign in to comment.