Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Test / MockObject.pm
1 package Test::MockObject;
2
3 use strict;
4 use warnings;
5
6 use vars qw( $VERSION $AUTOLOAD );
7 $VERSION = '1.09';
8
9 use Scalar::Util qw( blessed refaddr reftype weaken );
10 use UNIVERSAL::isa;
11 use UNIVERSAL::can;
12
13 use Test::Builder;
14
15 my $Test = Test::Builder->new();
16 my (%calls, %subs);
17
18 sub new
19 {
20     my ($class, $type) = @_;
21     $type ||= {};
22     bless $type, $class;
23 }
24
25 sub mock
26 {
27     my ($self, $name, $sub) = @_;
28     $sub ||= sub {};
29
30     # leading dash means unlog, otherwise do log
31     _set_log( $self, $name, ( $name =~ s/^-// ? 0 : 1 ) );
32     _subs( $self )->{$name} = $sub;
33
34     $self;
35 }
36
37 sub set_isa
38 {
39     my ($self, @supers) = @_;
40     my $supers          = _isas( $self );
41     $supers->{$_}       = 1 for @supers;
42 }
43
44 sub set_always
45 {
46     my ($self, $name, $value) = @_;
47     $self->mock( $name, sub { $value } );
48 }
49
50 sub set_true
51 {
52     my $self = shift;
53
54     for my $name ( @_ )
55     {
56         $self->mock( $name, sub { 1 } );
57     }
58
59     return $self;
60 }
61
62 sub set_false
63 {
64     my $self = shift;
65
66     for my $name ( @_ )
67     {
68         $self->mock( $name, sub {} );
69     }
70
71     return $self;
72 }
73
74 sub set_list
75 {
76     my ($self, $name, @list) = @_;
77     $self->mock( $name, sub { @{[ @list ]} } );
78 }
79
80 sub set_series
81 {
82     my ($self, $name, @list) = @_;
83     $self->mock( $name, sub { return unless @list; shift @list } );
84 }
85
86 sub set_bound
87 {
88     my ($self, $name, $ref) = @_;
89
90     my %bindings =
91     (
92         SCALAR => sub { $$ref },
93         ARRAY  => sub { @$ref },
94         HASH   => sub { %$ref },
95     );
96
97     return unless exists $bindings{reftype( $ref )};
98     $self->mock( $name,  $bindings{reftype( $ref )} );
99 }
100
101 # hack around debugging mode being too smart for my sub names
102 my $old_p;
103 BEGIN
104 {
105     $old_p  = $^P;
106     $^P    &= ~0x200;
107 }
108
109 BEGIN
110 {
111     for my $universal
112     ( { sub => \&_subs, name => 'can' }, { sub => \&_isas, name => 'isa' } )
113     {
114         my $sub = sub
115         {
116             my ($self, $sub) = @_;
117             local *__ANON__  = $universal->{name};
118
119             # mockmethods are special cases, class methods are handled directly
120             my $lookup = $universal->{sub}->( $self );
121             return $lookup->{$sub} if blessed $self and exists $lookup->{$sub};
122             my $parent = 'SUPER::' . $universal->{name};
123             return $self->$parent( $sub );
124         };
125
126         no strict 'refs';
127         *{ $universal->{name} } = $sub;
128     }
129
130     $^P = $old_p;
131 }
132
133 sub remove
134 {
135     my ($self, $sub) = @_;
136     delete _subs( $self )->{$sub};
137     $self;
138 }
139
140 sub called
141 {
142     my ($self, $sub) = @_;
143
144     for my $called (reverse @{ _calls( $self ) })
145     {
146         return 1 if $called->[0] eq $sub;
147     }
148
149     return 0;
150 }
151
152 sub clear
153 {
154     my $self             = shift;
155     @{ _calls( $self ) } = ();
156     $self;
157 }
158
159 sub call_pos
160 {
161     $_[0]->_call($_[1], 0);
162 }
163
164 sub call_args
165 {
166     return @{ $_[0]->_call($_[1], 1) };
167 }
168
169 sub _call
170 {
171     my ($self, $pos, $type) = @_;
172     my $calls               = _calls( $self );
173     return if abs($pos) > @$calls;
174     $pos-- if $pos > 0;
175     return $calls->[$pos][$type];
176 }
177
178 sub call_args_string
179 {
180     my $args = $_[0]->_call( $_[1], 1 ) or return;
181     return join($_[2] || '', @$args);
182 }
183
184 sub call_args_pos
185 {
186     my ($self, $subpos, $argpos) = @_;
187     my $args = $self->_call( $subpos, 1 ) or return;
188     $argpos-- if $argpos > 0;
189     return $args->[$argpos];
190 }
191
192 sub next_call
193 {
194     my ($self, $num)  = @_;
195     $num            ||= 1;
196
197     my $calls = _calls( $self );
198     return unless @$calls >= $num;
199
200     my ($call) = (splice(@$calls, 0, $num))[-1];
201     return wantarray() ? @$call : $call->[0];
202 }
203
204 sub AUTOLOAD
205 {
206     my $self = shift;
207     my $sub;
208     {
209         local $1;
210         ($sub) = $AUTOLOAD =~ /::(\w+)\z/;
211     }
212     return if $sub eq 'DESTROY';
213
214     $self->dispatch_mocked_method( $sub, @_ );
215 }
216
217 sub dispatch_mocked_method
218 {
219     my $self = $_[0];
220     my $sub  = splice( @_, 1, 1 );
221
222     my $subs = _subs( $self );
223     if (exists $subs->{$sub})
224     {
225         $self->log_call( $sub, @_ );
226         goto &{ $subs->{$sub} };
227     }
228     else
229     {
230         require Carp;
231         Carp::carp("Un-mocked method '$sub()' called");
232     }
233
234     return;
235 }
236
237 sub log_call
238 {
239     my ($self, $sub, @call_args) = @_;
240     return unless _logs( $self, $sub );
241
242     # prevent circular references with weaken
243     for my $arg ( @call_args )
244     {
245         next unless ref $arg;
246         weaken( $arg ) if refaddr( $arg ) eq refaddr( $self );
247     }
248
249     push @{ _calls( $self ) }, [ $sub, \@call_args ];
250 }
251
252 sub called_ok
253 {
254     my ($self, $sub, $name) = @_;
255     $name ||= "object called '$sub'";
256     $Test->ok( $self->called($sub), $name );
257 }
258
259 sub called_pos_ok
260 {
261     my ($self, $pos, $sub, $name) = @_;
262     $name ||= "object called '$sub' at position $pos";
263     my $called = $self->call_pos($pos, $sub);
264     unless ($Test->ok( (defined $called and $called eq $sub), $name ))
265     {
266         $called = 'undef' unless defined $called;
267         $Test->diag("Got:\n\t'$called'\nExpected:\n\t'$sub'\n");
268     }
269 }
270
271 sub called_args_string_is
272 {
273     my ($self, $pos, $sep, $expected, $name) = @_;
274     $name ||= "object sent expected args to sub at position $pos";
275     $Test->is_eq( $self->call_args_string( $pos, $sep ), $expected, $name );
276 }
277
278 sub called_args_pos_is
279 {
280     my ($self, $pos, $argpos, $arg, $name) = @_;
281     $name ||= "object sent expected arg '$arg' to sub at position $pos";
282     $Test->is_eq( $self->call_args_pos( $pos, $argpos ), $arg, $name );
283 }
284
285 sub fake_module
286 {
287     my ($class, $modname, %subs) = @_;
288
289     if ($class->check_class_loaded( $modname ) and ! keys %subs)
290     {
291         require Carp;
292         Carp::croak( "No mocked subs for loaded module '$modname'" );
293     }
294
295     $modname =~ s!::!/!g;
296     $INC{ $modname . '.pm' } = 1;
297
298     no warnings 'redefine';
299     {
300         no strict 'refs';
301         ${ $modname . '::' }{VERSION} ||= -1;
302     }
303
304     for my $sub (keys %subs)
305     {
306         my $type = reftype( $subs{ $sub } ) || '';
307         unless ( $type eq 'CODE' )
308         {
309             require Carp;
310             Carp::carp("'$sub' is not a code reference" );
311             next;
312         }
313         no strict 'refs';
314         *{ $_[1] . '::' . $sub } = $subs{ $sub };
315     }
316 }
317
318 sub check_class_loaded
319 {
320     my ($self, $class, $load_flag) = @_;
321
322     (my $path    = $class) =~ s{::}{/}g;
323     return 1 if exists $INC{ $path . '.pm' };
324
325     my $symtable = \%main::;
326     my $found    = 1;
327
328     for my $symbol ( split( '::', $class ))
329     {
330         unless (exists $symtable->{ $symbol . '::' })
331         {
332             $found = 0;
333             last;
334         }
335
336         $symtable = $symtable->{ $symbol . '::' };
337     }
338
339     return $found;
340 }
341
342 sub fake_new
343 {
344     my ($self, $class) = @_;
345     $self->fake_module( $class, new => sub { $self } );
346 }
347
348 sub DESTROY
349 {
350     my $self = shift;
351     $self->_clear_calls();
352     $self->_clear_subs();
353     $self->_clear_logs();
354     $self->_clear_isas();
355 }
356
357 sub _get_key
358 {
359     my $invocant = shift;
360     return blessed( $invocant ) ? refaddr( $invocant ) : $invocant;
361 }
362
363 {
364     my %calls;
365
366     sub _calls
367     {
368         $calls{ _get_key( shift ) } ||= [];
369     }
370
371     sub _clear_calls
372     {
373         delete $calls{ _get_key( shift ) };
374     }
375 }
376
377 {
378     my %subs;
379
380     sub _subs
381     {
382         $subs{ _get_key( shift ) } ||= {};
383     }
384
385     sub _clear_subs
386     {
387         delete $subs{ _get_key( shift ) };
388     }
389 }
390
391 {
392     my %logs;
393
394     sub _set_log
395     {
396         my $key          = _get_key( shift );
397         my ($name, $log) = @_;
398
399         $logs{$key} ||= {};
400
401         if ($log)
402         {
403             $logs{$key}{$name} = 1;
404         }
405         else
406         {
407             delete $logs{$key}{$name};
408         }
409     }
410
411     sub _logs
412     {
413         my $key    = _get_key( shift );
414         my ($name) = @_;
415         return exists $logs{$key}{$name};
416     }
417
418     sub _clear_logs
419     {
420         delete $logs{ _get_key( shift ) };
421     }
422 }
423
424 {
425     my %isas;
426
427     sub _isas
428     {
429         $isas{ _get_key( shift ) } ||= {};
430     }
431
432     sub _clear_isas
433     {
434         delete $isas{ _get_key( shift ) };
435     }
436 }
437
438 1;
439
440 __END__
441
442 =head1 NAME
443
444 Test::MockObject - Perl extension for emulating troublesome interfaces
445
446 =head1 SYNOPSIS
447
448   use Test::MockObject;
449   my $mock = Test::MockObject->new();
450   $mock->set_true( 'somemethod' );
451   ok( $mock->somemethod() );
452
453   $mock->set_true( 'veritas')
454          ->set_false( 'ficta' )
455        ->set_series( 'amicae', 'Sunny', 'Kylie', 'Bella' );
456
457 =head1 DESCRIPTION
458
459 It's a simple program that doesn't use any other modules, and those are easy to
460 test.  More often, testing a program completely means faking up input to
461 another module, trying to coax the right output from something you're not
462 supposed to be testing anyway.
463
464 Testing is a lot easier when you can control the entire environment.  With
465 Test::MockObject, you can get a lot closer.
466
467 Test::MockObject allows you to create objects that conform to particular
468 interfaces with very little code.  You don't have to reimplement the behavior,
469 just the input and the output.
470
471 =head2 IMPORTANT CAVEAT FOR TESTERS
472
473 Please note that it is possible to write highly detailed unit tests that pass
474 even when your integration tests may fail.  Testing the pieces individually
475 does not excuse you from testing the whole thing together.  I consider this to
476 be a feature.
477
478 In cases where you only need to mock one or two pieces of an existing module,
479 consider L<Test::MockObject::Extends> instead.
480
481 =head2 EXPORT
482
483 None by default.  Maybe the Test::Builder accessories, in a future version.
484
485 =head2 FUNCTIONS
486
487 The most important thing a Mock Object can do is to conform sufficiently to an
488 interface.  For example, if you're testing something that relies on CGI.pm, you
489 may find it easier to create a mock object that returns controllable results
490 at given times than to fake query string input.
491
492 =head3 The Basics
493
494 =over 4
495
496 =item * C<new>
497
498 Creates a new mock object.  By default, this is a blessed hash.  Pass a
499 reference to bless that reference.
500
501     my $mock_array  = Test::MockObject->new( [] );
502     my $mock_scalar = Test::MockObject->new( \( my $scalar ) );
503     my $mock_code   = Test::MockObject->new( sub {} );
504     my $mock_glob   = Test::MockObject->new( \*GLOB );
505
506 =back
507
508 =head3 Mocking
509
510 Your mock object is nearly useless if you don't tell it what it's mocking.
511 This is done by installing methods.  You control the output of these mocked
512 methods.  In addition, any mocked method is tracked.  You can tell not only
513 what was called, but which arguments were passed.  Please note that you cannot
514 track non-mocked method calls.  They will still be allowed, though
515 Test::MockObject will carp() about them.  This is considered a feature, though
516 it may be possible to disable this in the future.
517
518 As implied in the example above, it's possible to chain these calls together.
519 Thanks to a suggestion from the fabulous Piers Cawley (CPAN RT #1249), this
520 feature came about in version 0.09.  Shorter testing code is nice!
521
522 =over 4
523
524 =item * C<mock(I<name>, I<coderef>)>
525
526 Adds a coderef to the object.  This allows code to call the named method on the
527 object.  For example, this code:
528
529     my $mock = Test::MockObject->new();
530     $mock->mock( 'fluorinate',
531         sub { 'impurifying precious bodily fluids' } );
532     print $mock->fluorinate;
533
534 will print a helpful warning message.  Please note that methods are only added
535 to a single object at a time and not the class.  (There is no small similarity
536 to the Self programming language or the Class::Prototyped module.)
537
538 This method forms the basis for most of Test::MockObject's testing goodness.
539
540 B<Please Note:> this method used to be C<add()>.  Due to its ambiguity, it now
541 has a different spelling.  For backwards compatibility purposes, add() is
542 available, though version 0.07 deprecated it.  It goes to some contortions to
543 try to do what you mean, but I make few guarantees.
544
545 =item * C<fake_module(I<module name>), [ I<subname> => I<coderef>, ... ]
546
547 B<Note:> this method will likely become a separate module in the near future.
548
549 Lies to Perl that it has already loaded a named module.  This is handy when
550 providing a mockup of a real module if you'd like to prevent the actual module
551 from interfering with the nice fakery.  If you're mocking L<Regexp::English>,
552 say:
553
554     $mock->fake_module( 'Regexp::English' );
555
556 This is both a class and as an object method.  Beware that this must take place
557 before the actual module has a chance to load.  Either wrap it in a BEGIN block
558 before a use or require or place it before a C<use_ok()> or C<require_ok()>
559 call.
560
561 You can optionally add functions to the mocked module by passing them as name
562 => coderef pairs to C<fake_module()>.  This is handy if you want to test an
563 C<import()>:
564
565     my $import;
566     $mock->fake_module(
567         'Regexp::English',
568         import => sub { $import = caller }
569     );
570     use_ok( 'Regexp::Esperanto' );
571     is( $import, 'Regexp::Esperanto',
572         'Regexp::Esperanto should use() Regexp::English' );
573
574 If you use C<fake_module()> to mock a module that already exists in memory --
575 one you've loaded elsewhere perhaps, but do not pass any subroutines to mock,
576 this method will throw an exception.  This is because if you call the
577 constructor later on, you probably won't get a mock object back and you'll be
578 confused.
579
580 =item * C<fake_new(I<module name>)>
581
582 B<Note:> see L<Test::MockObject::Extends> for a better alternative to this
583 method.
584
585 Provides a fake constructor for the given module that returns the invoking mock
586 object.  Used in conjunction with C<fake_module()>, you can force the tested
587 unit to work with the mock object instead.
588
589     $mock->fake_module( 'CGI' );
590     $mock->fake_new( 'CGI' );
591
592     use_ok( 'Some::Module' );
593     my $s = Some::Module->new();
594     is( $s->{_cgi}, $mock,
595         'new() should create and store a new CGI object' );
596
597 =item * C<set_always(I<name>, I<value>)>
598
599 Adds a method of the specified name that always returns the specified value.
600
601 =item * C<set_true(I<name_1>, I<name_2>, ... I<name_n>)>
602
603 Adds a method of the specified name that always returns a true value.  This can
604 take a list of names.
605
606 =item * C<set_false(I<name_1>, I<name_2>, ... I<name_n>)>
607
608 Adds a method of the specified name that always returns a false value.  (Since
609 it installs an empty subroutine, the value should be false in both scalar and
610 list contexts.)  This can take a list of names.
611
612 =item * C<set_list(I<name>, [ I<item1>, I<item2>, ... ]>
613
614 Adds a method that always returns a given list of values.  It takes some care
615 to provide a list and not an array, if that's important to you.
616
617 =item * C<set_series(I<name>, [ I<item1>, I<item2>, ... ]>
618
619 Adds a method that will return the next item in a series on each call.  This
620 can help to test error handling, by forcing a failure on the first method call
621 and then subsequent successes.  Note that the series does not repeat; it will
622 eventually run out.
623
624 =item * C<set_bound(I<name>, I<reference>)>
625
626 Adds a method bound to a variable.  Pass in a reference to a variable in your
627 test.  When you change the variable, the return value of the new method will
628 change as well.  This is often handier than replacing mock methods.
629
630 =item * C<set_isa( I<name1>, I<name2>, ... I<namen> )>
631
632 Adds an apparent parent to the module, so that calling C<isa()> on the mock
633 will return true appropriately.  Sometimes you really need this.
634
635 =item * C<remove(I<name>)>
636
637 Removes a named method.
638
639 =back
640
641 =head3 Checking Your Mocks
642
643 =over 4
644
645 =item * C<can( $method_name )>
646
647 Returns a subroutine reference if this particular mocked object can handle the
648 named method, false otherwise.
649
650 =item * C<isa( $class_name )>
651
652 Returns true if the invocant object mocks a particular class.  You must have
653 used C<set_isa()> first.
654
655 =item * C<called(I<name>)>
656
657 Checks to see if something has called a named method on the object.  This
658 returns a boolean value.  The current implementation does not scale especially
659 well, so use this sparingly if you need to search through hundreds of calls.
660
661 =item * C<clear()>
662
663 Clears the internal record of all method calls on the object.  It's handy to do
664 this every now and then.  Note that this does not affect the mocked methods,
665 only all of the methods called on the object to this point.
666
667 It's handy to C<clear()> methods in between series of tests.  That makes it
668 much easier to call C<next_method()> without having to skip over the calls from
669 the last set of tests.
670
671 =item * C<next_call([ I<position> ])>
672
673 Returns the name and argument list of the next mocked method called on an
674 object, in list context.  In scalar context, returns only the method name.
675 There are two important things to know about this method.  First, it starts at
676 the beginning of the call list.  If your code runs like this:
677
678     $mock->set_true( 'foo' );
679     $mock->set_true( 'bar' );
680     $mock->set_true( 'baz' );
681
682     $mock->foo();
683     $mock->bar( 3, 4 );
684     $mock->foo( 1, 2 );
685
686 Then you might see output of:
687
688     my ($name, $args) = $mock->next_call();
689     print "$name (@$args)";
690
691     # prints 'foo'
692
693     $name = $mock->next_call();
694     print $name;
695
696     # prints 'bar'
697
698     ($name, $args) = $mock->next_call();
699     print "$name (@$args)";
700
701     # prints 'foo 1 2'
702
703 If you provide an optional number as the I<position> argument, the method will
704 skip that many calls, returning the data for the last one skipped.
705
706     $mock->foo();
707     $mock->bar();
708     $mock->baz();
709
710     $name = $mock->next_call();
711     print $name;
712
713     # prints 'foo'
714
715     $name = $mock->next_call( 2 );
716     print $name
717
718     # prints 'baz'
719
720 When it reaches the end of the list, it returns undef.  This is probably the
721 most convenient method in the whole module, but for the sake of completeness
722 and backwards compatibility (it takes me a while to reach the truest state of
723 laziness!), there are several other methods.
724
725 =item * C<call_pos(I<position>)>
726
727 Returns the name of the method called on the object at a specified position.
728 This is handy if you need to test a certain order of calls.  For example:
729
730     Some::Function( $mock );
731     is( $mock->call_pos(1),  'setup',
732         'Function() should first call setup()' );
733     is( $mock->call_pos(-1), 'end',
734         '... and last call end()' );
735
736 Positions can be positive or negative.  Please note that the first position is,
737 in fact, 1.  (This may change in the future.  I like it, but am willing to
738 reconsider.)
739
740 =item * C<call_args(I<position>)>
741
742 Returns a list of the arguments provided to the method called at the appropriate
743 position.  Following the test above, one might say:
744
745     is( ($mock->call_args(1))[0], $mock,
746         '... passing the object to setup()' );
747     is( scalar $mock->call_args(-1), 0,
748         '... and no args to end()' );
749
750 =item * C<call_args_pos(I<call position>, I<argument position>)>
751
752 Returns the argument at the specified position for the method call at the
753 specified position.  One might rewrite the first test of the last example as:
754
755     is( $mock->call_args_pos(1, 1), $mock,
756         '... passing the object to setup()');
757
758 =item * C<call_args_string(I<position>, [ I<separator> ])>
759
760 Returns a stringified version of the arguments at the specified position.  If
761 no separator is given, they will not be separated.  This can be used as:
762
763     is( $mock->call_args_string(1), "$mock initialize",
764         '... passing object, initialize as arguments' );
765
766 =item * C<called_ok(I<method name>, [ I<test name> ])>
767
768 Tests to see whether a method of the specified name has been called on the
769 object.  This and the following methods use Test::Builder, so they integrate
770 nicely with a test suite built around Test::Simple, Test::More, or anything
771 else compatible:
772
773     $mock->foo();
774     $mock->called_ok( 'foo' );
775
776 A generic default test name is provided.
777
778 =item * C<called_pos_ok(I<position>, I<method name>, [ I<test name> ])>
779
780 Tests to see whether the named method was called at the specified position.  A
781 default test name is provided.
782
783 =item * C<called_args_pos_is(I<method position>, I<argument position>, I<expected>, [ I<test name> ])>
784
785 Tests to see whether the argument at the appropriate position of the method in
786 the specified position equals a specified value.  A default, rather
787 non-descript test name is provided.
788
789 =item * C<called_args_string_is(I<method position>, I<separator>, I<expected>, [ I<test name> ])>
790
791 Joins together all of the arguments to a method at the appropriate position and
792 matches against a specified string.  A generically bland test name is provided
793 by default.  You can probably do much better.
794
795 =item * C<check_class_loaded( $class_name )>
796
797 Attempts to determine whether you have a class of the given name loaded and
798 compiled.  Returns true or false.
799
800 =back
801
802 =head3 Logging
803
804 Test::MockObject logs all mocked methods by default.  Sometimes you don't want
805 to do this.  To prevent logging all calls to a given method, prepend the name
806 of the method with C<-> when mocking it.
807
808 That is:
809
810     $mock->set_true( '-foo', 'bar' );
811
812 will set mock both C<foo()> and C<bar()>, causing both to return true.
813 However, the object will log only calls to C<bar()>, not C<foo()>.  To log
814 C<foo()> again, merely mock it again without the leading C<->:
815
816     $mock->set_true( 'foo' );
817
818 C<$mock> will log all subsequent calls to C<foo()> again.
819
820 =head3 Subclassing
821
822 There are two methods provided for subclassing:
823
824 =over 4
825
826 =item * C<dispatch_mocked_method( $method_name, @_ )>
827
828 This method determines how to call a method (named as C<$method_name>) not
829 available in this class.  It also controls logging.  You may or may not find it
830 useful, but I certainly take advantage of it for Test::MockObject::Extends.
831
832 =item * C<log_call( $method_name, @_ )>
833
834 This method tracks the call of the named method and its arguments.
835
836 =back
837
838 =head1 TODO
839
840 =over 4
841
842 =item * Add a factory method to avoid namespace collisions (soon)
843
844 =item * Add more useful methods (catch C<import()>?)
845
846 =back
847
848 =head1 AUTHOR
849
850 chromatic, E<lt>chromatic at wgz dot orgE<gt>
851
852 Thanks go to Curtis 'Ovid' Poe, as well as ONSITE! Technology, Inc., for
853 finding several bugs and providing several constructive suggestions.
854
855 Jay Bonci also found a false positive in C<called_ok()>.  Thanks!
856
857 Chris Winters was the first to report I'd accidentally scheduled 0.12 for
858 deletion without uploading a newer version.  He also gave useful feedback on
859 Test::MockObject::Extends.
860
861 Stevan Little provided the impetus and code for C<set_isa()>.
862
863 Nicholas Clark found a documentation error.
864
865 Mutant suggested a potential problem with fake_module().
866
867 =head1 SEE ALSO
868
869 L<perl>, L<Test::Tutorial>, L<Test::More>,
870 L<http:E<sol>E<sol>www.perl.comE<sol>pubE<sol>aE<sol>2001E<sol>12E<sol>04E<sol>testing.html>,
871 and
872 L<http:E<sol>E<sol>www.perl.comE<sol>pubE<sol>aE<sol>2002E<sol>07E<sol>10E<sol>tmo.html>.
873
874 =head1 COPYRIGHT
875
876 Copyright (c) 2002 - 2008 by chromatic E<lt>chromatic at wgz dot orgE<gt>.
877
878 This program is free software; you can use, modify, and redistribute it under
879 the same terms as Perl 5.10.x itself.
880
881 See http://www.perl.com/perl/misc/Artistic.html
882
883 =cut