1use Test::Most; 2 3require_ok('Net::FreeDB'); 4 5my $freedb = new Net::FreeDB(); 6ok($freedb, 'Unable to create instance'); 7 8if ($ENV{HAVE_INTERNET}) { 9 my $response; 10 ok($response = $freedb->read('newage', '940a040c')); 11 isa_ok($response, 'CDDB::File', 'Error, object type is unexpected'); 12 13 ok($response->id eq '940a040c', "Error: @{[ $response->id ]} is NOT the expected 940a040c"); 14 ok($response->artist eq 'Deep Forest', "Error: @{[ $response->artist ]} is NOT the expected Deep Forest"); 15 ok($response->title eq 'Boheme', "Error: @{[ $response->title ]} is NOT the expected Boheme"); 16 ok($response->length == 2566, "Error: @{[ $response->length ]} is NOT the expected 2566"); 17 ok($response->track_count == 12, "Error: @{[ $response->track_count ]} is NOT the expected 12"); 18} 19 20done_testing; 21