forked from PerlDancer/Dancer
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the object dir with every test ordered into four files.
- Loading branch information
Showing
13 changed files
with
97 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use strict; | ||
use warnings; | ||
use Test::More tests => 15; | ||
use Dancer::Script; | ||
|
||
use_ok( 'Dancer::Script' ); | ||
my $script = Dancer::Script->new(appname => 'Hello::World', path => '.', check_version => '1'); | ||
isa_ok( $script, 'Dancer::Script', ); | ||
can_ok( $script, 'parse_opts', 'validate_app_name', ); | ||
can_ok( $script, '_set_application_path', '_set_script_path', '_set_lib_path', ); | ||
|
||
isnt( $script->_dash_name, $script->{appname}, '_dash_name parses appname correctly.'); | ||
|
||
is( $script->{dancer_app_dir}, $script->{dancer_script}, "_set_application_path sets correctly ->{dancer_app_dir}"); | ||
|
||
|
||
my @lib_path = split('::', $script->{appname}); | ||
my ($lib_file, $lib_path) = (pop @lib_path) . ".pm"; | ||
|
||
is( $script->{lib_file}, $lib_file, "_set_lib_path sets correctly ->{lib_file} and ->{lib_path}"); | ||
is( $script->{lib_path}, $lib_path, "_set_lib_path sets correctly ->{lib_file} and ->{lib_path}"); | ||
|
||
is( $script->{dancer_script}, $script->_dash_name, "_set_script_path sets correctly ->{dancer_script}"); | ||
|
||
my $list = $script->app_tree; | ||
|
||
ok (defined $list, 'app_tree successfully returns a list.'); | ||
|
||
my $jquery = $script->jquery_minified; | ||
|
||
ok ( defined $jquery, 'jquery_minified returns a jquery code.'); | ||
ok ( $jquery =~ m/jQuery JavaScript Library/i, 'jQuery string identified.'); | ||
|
||
my $skip = $script->manifest_skip; | ||
|
||
ok ( defined $skip, 'manifest_skip returns a string.'); | ||
ok ( $skip =~ m/\.git/i, 'Skip items identified.'); | ||
|
||
my $templates = $script->templates; | ||
|
||
ok ( defined $templates, 'templates method returns a list.'); |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use strict; | ||
use warnings; | ||
use Test::More tests => 4; | ||
use File::Temp; | ||
use File::Spec::Functions; | ||
use Dancer::Script; | ||
|
||
my $dir = File::Temp->newdir(); | ||
my $tmpdir = $dir->dirname; | ||
my $template = { 'test' => 'testing', }; | ||
my $script = Dancer::Script->new(appname => 'Hello', path => $tmpdir, check_version => '1'); | ||
my $dancer_app_dir = $script->{dancer_app_dir}; | ||
|
||
#tests | ||
|
||
# TODO-to-every-t: Supress the print messages from the *print* outputs. | ||
ok( $script->safe_mkdir($dancer_app_dir),"safe_mkdir method sucessfully wrote a directory."); | ||
|
||
ok( $script->run,"successfully created a full Dancer app."); | ||
|
||
ok( $script->write_bg(catfile($script->{path},$script->{appname}, 'public', 'images', 'perldancer-bg.jpg')), | ||
"write_data_to_file method sucessfully wrote a file."); | ||
|
||
ok( $script->write_file(catfile($script->{path},$script->{appname},'t','test'),$template), "write_file successfully writes a file."); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use strict; | ||
use warnings; | ||
use Test::More tests => 4; | ||
use File::Temp; | ||
use File::Spec::Functions; | ||
use Dancer::Script; | ||
|
||
my $dir = File::Temp->newdir(); | ||
my $tmpdir = $dir->dirname; | ||
my $script = Dancer::Script->new(appname => 'Hello', path => $tmpdir, check_version => '1'); | ||
|
||
#tests | ||
# TODO: Supress the print messages from the *print* outputs. | ||
can_ok( $script, 'run'); | ||
|
||
# -new->run() write test. | ||
ok( $script->run,"successfully created a full Dancer app."); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.