Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed formatting with latest perltidy
- Loading branch information
Showing
3 changed files
with
40 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
use Mojo::Base -strict; | ||
|
||
BEGIN { $ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll' } | ||
|
||
use Test::More; | ||
use Cwd 'cwd'; | ||
use File::Spec::Functions 'catdir'; | ||
use File::Temp 'tempdir'; | ||
use Mojolicious::Command; | ||
|
||
# Application | ||
my $command = Mojolicious::Command->new; | ||
isa_ok $command->app, 'Mojo', 'right application'; | ||
isa_ok $command->app, 'Mojolicious', 'right application'; | ||
|
||
# Generating files | ||
my $cwd = cwd; | ||
my $dir = tempdir CLEANUP => 1; | ||
chdir $dir; | ||
$command->create_rel_dir('foo/bar'); | ||
ok -d catdir(qw(foo bar)), 'directory exists'; | ||
my $template = "@@ foo_bar\njust <%= 'works' %>!\n"; | ||
open my $data, '<', \$template; | ||
no strict 'refs'; | ||
*{"Mojolicious::Command::DATA"} = $data; | ||
$command->render_to_rel_file('foo_bar', 'bar/baz.txt'); | ||
open my $txt, '<', $command->rel_file('bar/baz.txt'); | ||
is join('', <$txt>), "just works!\n", 'right result'; | ||
$command->chmod_rel_file('bar/baz.txt', 0700); | ||
ok -e $command->rel_file('bar/baz.txt'), 'file is executable'; | ||
$command->write_rel_file('123.xml', "seems\nto\nwork"); | ||
open my $xml, '<', $command->rel_file('123.xml'); | ||
is join('', <$xml>), "seems\nto\nwork", 'right result'; | ||
chdir $cwd; | ||
|
||
done_testing(); | ||
use Mojo::Base -strict; | ||
|
||
BEGIN { $ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll' } | ||
|
||
use Test::More; | ||
use Cwd 'cwd'; | ||
use File::Spec::Functions 'catdir'; | ||
use File::Temp 'tempdir'; | ||
use Mojolicious::Command; | ||
|
||
# Application | ||
my $command = Mojolicious::Command->new; | ||
isa_ok $command->app, 'Mojo', 'right application'; | ||
isa_ok $command->app, 'Mojolicious', 'right application'; | ||
|
||
# Generating files | ||
my $cwd = cwd; | ||
my $dir = tempdir CLEANUP => 1; | ||
chdir $dir; | ||
$command->create_rel_dir('foo/bar'); | ||
ok -d catdir(qw(foo bar)), 'directory exists'; | ||
my $template = "@@ foo_bar\njust <%= 'works' %>!\n"; | ||
open my $data, '<', \$template; | ||
no strict 'refs'; | ||
*{"Mojolicious::Command::DATA"} = $data; | ||
$command->render_to_rel_file('foo_bar', 'bar/baz.txt'); | ||
open my $txt, '<', $command->rel_file('bar/baz.txt'); | ||
is join('', <$txt>), "just works!\n", 'right result'; | ||
$command->chmod_rel_file('bar/baz.txt', 0700); | ||
ok -e $command->rel_file('bar/baz.txt'), 'file is executable'; | ||
$command->write_rel_file('123.xml', "seems\nto\nwork"); | ||
open my $xml, '<', $command->rel_file('123.xml'); | ||
is join('', <$xml>), "seems\nto\nwork", 'right result'; | ||
chdir $cwd; | ||
|
||
done_testing(); |