#!/usr/bin/perl

# Copryight (C) 2004-2005  Joshua Hoblitt
#
# $Id: 02_server_setup.t,v 1.5 2006-12-08 03:29:19 jhoblitt Exp $

use strict;
use warnings;

use Test::More tests => 2;

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

use Nebulous::Server;
use Test::Nebulous;

Test::Nebulous->setup;

isa_ok(
    Nebulous::Server->new(
        dsn         => "DBI:mysql:database=test:host=localhost",
        dbuser      => "test",
        dbpasswd    => "",
    ),
    "Nebulous::Server"
);

Test::Nebulous->setup;

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

Test::Nebulous->cleanup;
