root/trunk/t/empty-db.t @ 36

Revision 36, 1.0 kB (checked in by bradfitz, 4 years ago)

make tests test both sqlite and mysql

Line 
1# $Id$
2# -*-perl-*-
3
4use strict;
5use warnings;
6
7require 't/lib/db-common.pl';
8
9use TheSchwartz;
10use Test::More tests => 6;
11
12run_tests(3, sub {
13    teardown_dbs("tempty1");
14
15    my $client = TheSchwartz->new(databases => [
16                                                {
17                                                    dsn  => dsn_for('tempty1'),
18                                                    user => "root",
19                                                    pass => "",
20                                                },
21                                                ]);
22
23    # insert a job
24    {
25        my $handle;
26        $handle = $client->insert("Worker::Addition", { numbers => [1, 2] });
27        ok(!$handle, "can't insert into empty database");
28        $handle = $client->insert("Worker::Addition", { numbers => [1, 2] });
29        ok(!$handle, "still can't insert into empty database");
30    }
31
32    ok(1, "test finishes");
33    teardown_dbs("tempty1");
34});
35
Note: See TracBrowser for help on using the browser.