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 terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or (at
9 # your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 use POE qw[ Component::Client::MPD::Connection ];
29 my $id = POE::Session->create(
31 _start => \&_onpriv_start,
32 _mpd_error => \&_onpriv_mpd_error,
35 POE::Component::Client::MPD::Connection->spawn( {
45 $_[KERNEL]->alias_set('tester'); # increment refcount
48 sub _onpriv_mpd_error {
49 like( $_[ARG0]->error, qr/^connect: \(\d+\) /, 'connect error trapped' );