|
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 | |
|---|
| 4 | use strict; |
|---|
| 5 | use warnings; |
|---|
| 6 | |
|---|
| 7 | require 't/lib/db-common.pl'; |
|---|
| 8 | |
|---|
| 9 | use TheSchwartz; |
|---|
| 10 | use Test::More tests => 6; |
|---|
| 11 | |
|---|
| 12 | run_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 | |
|---|