xref: /openbsd-src/gnu/usr.bin/perl/dist/Term-ReadLine/t/ReadLine.t (revision 898184e3e61f9129feb5978fad5a8c6865f00b92)
1#!./perl -w
2use strict;
3
4package Term::ReadLine::Mock;
5our @ISA = 'Term::ReadLine::Stub';
6sub ReadLine {'Term::ReadLine::Mock'};
7sub readline { "a line" }
8sub new      { bless {} }
9
10package main;
11
12use Test::More tests => 15;
13
14BEGIN {
15    $ENV{PERL_RL} = 'Mock'; # test against our instrumented class
16    use_ok('Term::ReadLine');
17}
18
19my $t = new Term::ReadLine 'test term::readline';
20
21ok($t, "made something");
22
23isa_ok($t,          'Term::ReadLine::Mock');
24
25for my $method (qw( ReadLine readline addhistory IN OUT MinLine
26                    findConsole Attribs Features new ) ) {
27    can_ok($t, $method);
28}
29
30is($t->ReadLine,    'Term::ReadLine::Mock', "\$object->ReadLine");
31is($t->readline,    'a line',               "\$object->readline");
32
33