#!/usr/bin/perl

use strict;
use warnings;

use Test::More tests => 2;

use lib qw( ./t ./lib );

use PS::IPP::IData::Server;
use Test::IData;

Test::IData->setup;

ok(
    PS::IPP::IData::Server->setup(
        "DBI:mysql:database=test:host=localhost",
        "test",
        "",
    ),
    "connect",
);

Test::IData->setup;

eval {
    PS::IPP::IData::Server->setup(
        "DBI:mysql:database=foobar:host=localhost",
        "baz",
        "boo",
    );
};
like( $@, qr/DBI connect.*? failed/, "bad dsn/user/pass" );

Test::IData->cleanup;
