X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F03-fallback.t;h=9c2451eae9221a298d69b2c7f5c965141068d228;hb=929c8bab7d9cc5a7247006772efa931797016d59;hp=93129ae772ea48bc852bcadb1b528027665b4925;hpb=c5ef09dc0767113f5a35beeb4d4ce86bc84d774b;p=perl%2Fmodules%2FTest-Leaner.git diff --git a/t/03-fallback.t b/t/03-fallback.t index 93129ae..9c2451e 100644 --- a/t/03-fallback.t +++ b/t/03-fallback.t @@ -28,49 +28,16 @@ BEGIN { Test::More::is($loaded, 1, 'Test::More has been loaded'); } -sub get_subroutine { - my ($stash, $name) = @_; - - my $glob = $stash->{$name}; - return undef unless $glob; - - return *$glob{CODE}; -} - -sub has_module_version { - my ($module, $version) = @_; - - local $@; - eval qq{ - require $module; - "$module"->VERSION(\$version); - 1; - } -} - -sub has_test_more_version { has_module_version 'Test::More', @_ } +use lib 't/lib'; +use Test::Leaner::TestImport qw< + get_subroutine has_test_more_version default_exports +>; my $leaner_stash = \%Test::Leaner::; my $more_stash = \%Test::More::; my $this_stash = \%main::; -my @exported = qw< - plan - skip - done_testing - pass - fail - ok - is - isnt - like - unlike - cmp_ok - is_deeply - diag - note - BAIL_OUT ->; +my @exported = default_exports; for (@exported) { my $more_variant = get_subroutine($more_stash, $_);