The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!/usr/bin/perl

BEGIN {
  unless ($ENV{AUTHOR_TESTING}) {
    require Test::More;
    Test::More::plan(skip_all => 'these tests are for testing by the author');
  }
}


use strict; use warnings FATAL => 'all';
use Test::More 0.88;

BEGIN { use_ok( 'Net::Appliance::Session') }

my $s = new_ok( 'Net::Appliance::Session' => [{
    transport => "Telnet",
    ($^O eq 'MSWin32' ?
        (app => "$ENV{HOMEPATH}\\Desktop\\plink.exe") : () ),
    host => "route-server.bb.pipex.net",
    personality => "cisco",
    do_login => 0,
    do_paging => 0,
}]);

ok( $s->connect );

ok( $s->say("show ip bgp 163.1.0.0/16"), 'sent show ip bgp 163.1.0.0/16' );;
ok( $s->gather(), 'gathered output' );

like( $s->last_prompt, qr/\w+ ?>$/, 'command ran and last_prompt looks ok' );

my @out = $s->last_response;
cmp_ok( scalar @out, '==', 16, 'sensible number of lines in the command output');

done_testing;