----- Original Message ----

> From: Michael G Schwern <schw...@pobox.com>
>
> A simple strategy might be to just replace the global singleton with the
> child's guts at the start of a subtest() and then back out again at the end.
> 
>     %$Test = %$child;

I don't think that the child should ever have knowledge of the parent, but I 
could easily be wrong.  What if I am wrong?  With that strategy, you can't do 
this:

  my $builder = Test::Builder->new;
  subtest 'some test' => sub {
      plan tests => 13;
      if ( $builder->some_method ) { ... } # surprise!
  };

Of course, you don't get something for nothing.

Oh, and I just uploaded a new Test::JSON to make sure it works with subtests :)

 
Cheers,
Ovid
--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Tech blog            - http://use.perl.org/~Ovid/journal/
Twitter              - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Reply via email to