File: 03-read.t

package info (click to toggle)
libnet-freedb-perl 0.10-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 312 kB
  • sloc: ansic: 896; perl: 336; makefile: 5
file content (20 lines) | stat: -rw-r--r-- 820 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use Test::Most;

require_ok('Net::FreeDB');

my $freedb = new Net::FreeDB();
ok($freedb, 'Unable to create instance');

if ($ENV{HAVE_INTERNET}) {
    my $response;
    ok($response = $freedb->read('newage', '940a040c'));
    isa_ok($response, 'CDDB::File', 'Error, object type is unexpected');
    
    ok($response->id eq '940a040c', "Error: @{[ $response->id ]} is NOT the expected 940a040c");
    ok($response->artist eq 'Deep Forest', "Error: @{[ $response->artist ]} is NOT the expected Deep Forest");
    ok($response->title eq 'Boheme', "Error: @{[ $response->title ]} is NOT the expected Boheme");
    ok($response->length == 2566, "Error: @{[ $response->length ]} is NOT the expected 2566");
    ok($response->track_count == 12, "Error: @{[ $response->track_count ]} is NOT the expected 12");
}

done_testing;