3 # This file is part of POE::Component::Client::MPD.
4 # Copyright (c) 2007 Jerome Quelin, all rights reserved.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the same terms as Perl itself.
14 use POE qw[ Component::Client::MPD::Message ];
21 title.ogg dir1/title-artist-album.ogg
22 dir1/title-artist.ogg dir2/album.ogg
25 # [ 'event', [ $arg1, $arg2, ... ], $answer_back, \&check_results ]
27 [ 'pl.clear', [], $DISCARD, undef ],
28 [ 'pl.add', \@songs, $DISCARD, undef ],
31 [ 'pl.as_items', [], $SEND, \&check_as_items ],
33 # pl.items_changed_since
34 [ 'pl.items_changed_since', [0], $SEND, \&check_items_changed ],
39 # are we able to test module?
40 eval 'use POE::Component::Client::MPD::Test';
41 plan skip_all => $@ if $@ =~ s/\n+BEGIN failed--compilation aborted.*//s;
45 my @items = @{ $_[0]->data };
46 isa_ok( $_, 'POE::Component::Client::MPD::Item::Song',
47 'pl.as_items() returns POCOCM::Item::Song objects' ) for @items;
48 is( $items[0]->title, 'ok-title', 'first song reported first' );
51 sub check_items_changed {
52 my @items = @{ $_[0]->data };
53 isa_ok( $_, 'POE::Component::Client::MPD::Item::Song',
54 'items_changed_since() returns POCOCM::Item::Song objects' )
56 is( $items[0]->title, 'ok-title', 'first song reported first' );