Changeset 138
- Timestamp:
- 06/16/08 17:36:19 (2 months ago)
- Files:
-
- trunk/lib/TheSchwartz.pm (modified) (1 diff)
- trunk/t/api.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/TheSchwartz.pm
r137 r138 75 75 $driver = $client->{cached_drivers}{$hashdsn}{driver}; 76 76 } else { 77 my $db = $client->{databases}{$hashdsn}; 77 my $db = $client->{databases}{$hashdsn} 78 or croak "Ouch, I don't know about a database whose hash is $hashdsn"; 78 79 $driver = Data::ObjectDriver::Driver::DBI->new( 79 80 dsn => $db->{dsn}, trunk/t/api.t
r124 r138 8 8 9 9 use TheSchwartz; 10 use Test::More tests => 84;10 use Test::More tests => 108; 11 11 12 12 run_tests(42, sub { … … 82 82 $handle = $client->insert($job); 83 83 isa_ok $handle, 'TheSchwartz::JobHandle'; 84 85 my $same = $client->lookup_job($handle->as_string); 86 ok $same; 87 isa_ok $same, 'TheSchwartz::Job'; 88 is $same->handle->as_string, $handle->as_string; 89 90 } 91 92 ## Just test that handles for unknown database croak with an explicit message 93 { 94 eval { $client->lookup_job( ("6a" x 16) ."-666") }; 95 ok $@ && unlike($@, qr/No Driver/) && like($@, qr/database.*hash/); 84 96 } 85 97
