Commit | Line | Data |
d87edac9 |
1 | package # hide from PAUSE |
772c89c1 |
2 | RestrictByUserTest; |
3 | |
4 | use strict; |
5 | use warnings; |
6 | use RestrictByUserTest::Schema; |
7 | |
8 | sub init_schema { |
d87edac9 |
9 | my $self = shift; |
10 | my $db_file = "t/var/RestrictByUserTest.db"; |
772c89c1 |
11 | |
d87edac9 |
12 | unlink($db_file) if -e $db_file; |
13 | unlink($db_file . "-journal") if -e $db_file . "-journal"; |
14 | mkdir("t/var") unless -d "t/var"; |
772c89c1 |
15 | |
d87edac9 |
16 | my $schema = RestrictByUserTest::Schema->connect( "dbi:SQLite:${db_file}"); |
17 | $schema->deploy(); |
18 | return $schema; |
772c89c1 |
19 | } |
20 | |
21 | 1; |