Skip to content

Instantly share code, notes, and snippets.

@typester
Created August 7, 2009 10:17
Show Gist options
  • Save typester/163823 to your computer and use it in GitHub Desktop.
Save typester/163823 to your computer and use it in GitHub Desktop.
package Im::Test;
use Ark 'Test';
use File::Temp qw/tempdir/;
use Im::Models;
sub import {
my ($class, $app, %options) = @_;
$app ||= 'Im';
# mocked database
{
my $dir = tempdir( CLEANUP => 1 );
my $conf = models('conf');
$conf->{database} = [
"dbi:SQLite:$dir/database.db", undef, undef,
{ unicode => 1, ignore_version => 1 },
];
models('schema')->deploy;
}
@_ = ($class, $app, %options);
goto $class->can('SUPER::import');
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment