Skip to content

Instantly share code, notes, and snippets.

@iizukanao
Created October 19, 2010 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iizukanao/633571 to your computer and use it in GitHub Desktop.
Save iizukanao/633571 to your computer and use it in GitHub Desktop.
use Test::Base;
use File::Temp qw/tempdir/;
plan 'no_plan';
BEGIN { $ENV{ARK_HOME} = tempdir( CLEANUP => 1 ) }
{
package T::Models;
use Ark::Models '-base';
package T;
use Ark;
use_model 'T::Models';
package T::Controller::Root;
use Ark 'Controller';
T::Models->import; # use T::Models;
has '+namespace' => default => '';
sub index :Path :Args(0) {
my ($self, $c) = @_;
$c->res->body( 'hello' );
}
}
use Ark::Test 'T', components => [qw/Controller::Root/];
ok( T::Models->get('home'), 'home is defined ok' );
isa_ok( T::Models->get('home'), 'Path::Class::Dir');
ok( T::Models->get('conf'), 'conf is defined ok' );
isa_ok( T::Models->get('conf'), 'HASH');
is( get('/'), 'hello', 'get ok' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment