Created
          August 7, 2009 10:17 
        
      - 
      
- 
        Save typester/163823 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or 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
    
  
  
    
  | 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