Joe McMahon > Devel-Command-Tdump > Devel::TestEmbed

Download:
Devel-Command-Tdump-1.1.tar.gz

Annotate this POD

View/Report Bugs
Source  

NAME ^

Devel::TestEmbed - extend the debugger with Test::More

SYNOPSIS ^

  # We assume that the supplied perldb.sample has been
  # copied to the appropriate place.
  $ perl -demo
  Loading DB routines from perl5db.pl version 1.27
  Editor support available.

  Enter h or `h h' for help, or `man perldebug' for more help.

  main::(-e:1):   mo
  auto(-1)  DB<1> use Test::More qw(no_plan)

    DB<2> use_ok("CGI");

    DB<3> $obj = new CGI;

    DB<4> # Keep 'new CGI' in our test

    DB<5> isa_ok($obj, "CGI")
  ok 2 - The object isa CGI

    DB<6> tdump "our.t"
  Recording tests for this session in our.t ... done (2 tests).

    DB<7> q
  1..2
  $ cat our.t
  use Test::More tests=>2;
  use_ok("CGI");
  # Keep 'new CGI' in our test
  $obj = new CGI;
  isa_ok($obj, "CGI");

DESCRIPTION ^

The Devel::TestEmbed module loads Test::More for you, allowing you to use its functions to test code; you may then save the tests you used in this debugger session via the tdump function.

If needed, you may save "setup" code in the test as well by entering a comment at the debugger prompt after each line of such code.

The module defines an afterinit and watchfunction; you will need to take this into account if you wish to defined either of these yourself while using this function. See perldoc perl5db.pl for more informaton on these routines.

BUGS ^

Package switching is not captured at the moment.

AUTHOR ^

Joe McMahon <mcmahon@perl.com>.

syntax highlighting: