]>
Commit | Line | Data |
---|---|---|
1ce4e27c MG |
1 | #!/usr/bin/perl -w |
2 | use v5.14; | |
bbf8209c | 3 | |
f20668d7 | 4 | use Test::More tests => 6; |
bbf8209c | 5 | |
bbf8209c | 6 | BEGIN { use_ok('Gruntmaster::Data') }; |
acb202c6 MG |
7 | |
8 | my $db = Gruntmaster::Data->connect('dbi:SQLite:dbname=:memory:'); | |
9 | $db->deploy; | |
10 | ||
11 | $db->users->create({id => 'MGV'}); | |
12 | $db->contests->create({id => 'fc', start => 10, stop => 20, name => 'Finished contest', owner => 'MGV'}); | |
13 | $db->contests->create({id => 'rc', start => 20, stop => 30, name => 'Running contest', owner => 'MGV'}); | |
14 | $db->contests->create({id => 'pc', start => 30, stop => 40, name => 'Pending contest', owner => 'MGV'}); | |
15 | ||
16 | ok $db->contest('pc')->is_pending(25), 'is_pending'; | |
17 | ok !$db->contest('rc')->is_pending(25), '!is_pending'; | |
18 | ok $db->contest('fc')->is_finished(25), 'is_finished'; | |
19 | ok !$db->contest('rc')->is_finished(25), '!is_finished'; | |
20 | ok $db->contest('rc')->is_running(25), 'is_running'; |