Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
more Mojo::File tests
  • Loading branch information
kraih committed Jan 7, 2017
1 parent 7861725 commit a9f4983
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions t/mojo/file.t
Expand Up @@ -13,6 +13,10 @@ is path()->to_string, getcwd(), 'same path';
is path('/foo/bar'), '/foo/bar', 'same path';
is path('foo', 'bar', 'baz'), catfile('foo', 'bar', 'baz'), 'same path';

# Tap into method chain
is path('/home')->tap(sub { $$_ .= '/sri' })->to_string, '/home/sri',
'same path';

# Children
is path('foo', 'bar')->child('baz', 'yada'),
catfile(catfile('foo', 'bar'), 'baz', 'yada'), 'same path';
Expand Down
4 changes: 4 additions & 0 deletions t/mojolicious/ojo.t
Expand Up @@ -8,6 +8,7 @@ BEGIN {

use Test::More;
use ojo;
use File::Basename 'basename';

# Application
a('/' => sub { $_->render(data => $_->req->method . $_->req->body) })
Expand Down Expand Up @@ -44,6 +45,9 @@ is b('<foo>')->url_escape, '%3Cfoo%3E', 'right result';
# Collection
is c(1, 2, 3)->join('-'), '1-2-3', 'right result';

# File
is f(__FILE__)->basename, basename(__FILE__), 'right result';

# Dumper
is r([1, 2]), "[\n 1,\n 2\n]\n", 'right result';

Expand Down

0 comments on commit a9f4983

Please sign in to comment.