| 1 | package Test::Legacy::More; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use vars qw(@ISA); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 2 | require Test::More; | |||||||||
| 7 | 2 | @ISA = qw(Test::More); | |||||||||
| 8 | |||||||||||
| 9 | 2 | ▶ | sub import { | ||||||||
|
Subroutine
import: called CC=2 SCAR=7.0
| |||||||||||
| 10 | 2 | my $class = shift; | |||||||||
| 11 | 2 | my $caller = caller; | |||||||||
| 12 | |||||||||||
| 13 | 2 | my $ret = eval qq{ | |||||||||
| 14 | package $caller; | ||||||||||
| 15 | Test::More->import(\@_, import => [qw(!ok !skip !plan)]); | ||||||||||
| 16 | }; | ||||||||||
| 17 | |||||||||||
| 18 | 2 | ▶ | die $@ if $@; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | |||||||||||
| 20 | 2 | return $ret; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | |||||||||||
| 24 | =head1 NAME | ||||||||||
| 25 | |||||||||||
| 26 | Test::Legacy::More - Test::More wrapper for use with Test::Legacy | ||||||||||
| 27 | |||||||||||
| 28 | =head1 SYNOPSIS | ||||||||||
| 29 | |||||||||||
| 30 | use Test::Legacy; | ||||||||||
| 31 | use Test::Legacy::More; | ||||||||||
| 32 | |||||||||||
| 33 | ...use Test::Legacy and Test::More as normal... | ||||||||||
| 34 | |||||||||||
| 35 | =head1 DESCRIPTION | ||||||||||
| 36 | |||||||||||
| 37 | Both Test::Legacy and Test::More export functions called ok(), skip() | ||||||||||
| 38 | and plan(). When you use them together you have to tell Test::More | ||||||||||
| 39 | not to export those functions. | ||||||||||
| 40 | |||||||||||
| 41 | use Test::Legacy; | ||||||||||
| 42 | use Test::More import => [qw(!ok !skip !plan)]; | ||||||||||
| 43 | |||||||||||
| 44 | Since the purpose of Test::Legacy is to transition to Test::More it | ||||||||||
| 45 | can be a bit annoying to have to write that all the time. | ||||||||||
| 46 | Test::Legacy::More simply does that work for you. It loads Test::More | ||||||||||
| 47 | and supresses the exporting of any functions which might conflict with | ||||||||||
| 48 | Test::Legacy. It otherwise works just like Test::More. | ||||||||||
| 49 | |||||||||||
| 50 | |||||||||||
| 51 | =cut | ||||||||||
| 52 | |||||||||||
| 53 | 2 | 1; | |||||||||