source: trunk/essentials/dev-lang/perl/lib/Term/ReadLine.t

Last change on this file was 3181, checked in by bird, 18 years ago

perl 5.8.8

File size: 843 bytes
Line 
1#!./perl -w
2use strict;
3
4BEGIN {
5 if ( $ENV{PERL_CORE} ) {
6 chdir 't' if -d 't';
7 @INC = '../lib';
8 }
9}
10
11package Term::ReadLine::Mock;
12our @ISA = 'Term::ReadLine::Stub';
13sub ReadLine {'Term::ReadLine::Mock'};
14sub readline { "a line" }
15sub new { bless {} }
16
17package main;
18
19use Test::More tests => 15;
20
21BEGIN {
22 $ENV{PERL_RL} = 'Mock'; # test against our instrumented class
23 use_ok('Term::ReadLine');
24}
25
26my $t = new Term::ReadLine 'test term::readline';
27
28ok($t, "made something");
29
30isa_ok($t, 'Term::ReadLine::Mock');
31
32for my $method (qw( ReadLine readline addhistory IN OUT MinLine
33 findConsole Attribs Features new ) ) {
34 can_ok($t, $method);
35}
36
37is($t->ReadLine, 'Term::ReadLine::Mock', "\$object->ReadLine");
38is($t->readline, 'a line', "\$object->readline");
39
Note: See TracBrowser for help on using the repository browser.