1Test::Requires(3) User Contributed Perl Documentation Test::Requires(3)
2
3
4
6 Test::Requires - Checks to see if the module can be loaded
7
9 # in your Makefile.PL
10 use inc::Module::Install;
11 test_requires 'Test::Requires';
12
13 # in your test
14 use Test::More tests => 10;
15 use Test::Requires {
16 'HTTP::MobileAttribute' => 0.01, # skip all if HTTP::MobileAttribute doesn't installed
17 };
18 isa_ok HTTP::MobileAttribute->new, 'HTTP::MobileAttribute::NonMobile';
19
20 # or
21 use Test::More tests => 10;
22 use Test::Requires qw(
23 HTTP::MobileAttribute
24 );
25 isa_ok HTTP::MobileAttribute->new, 'HTTP::MobileAttribute::NonMobile';
26
27 # or
28 use Test::More tests => 10;
29 use Test::Requires;
30 test_requires 'Some::Optional::Test::Required::Modules';
31 isa_ok HTTP::MobileAttribute->new, 'HTTP::MobileAttribute::NonMobile';
32
34 Test::Requires checks to see if the module can be loaded.
35
36 If this fails rather than failing tests this skips all tests.
37
39 Tokuhiro Matsuno <tokuhirom @*(#RJKLFHFSDLJF gmail.com>
40
42 kazuho++ # some tricky stuff
43 miyagawa++ # original code from t/TestPlagger.pm
44 tomyhero++ # reported issue related older test::builder
45
47 "TestPlagger.pm" in t
48
50 This library is free software; you can redistribute it and/or modify it
51 under the same terms as Perl itself.
52
53
54
55perl v5.16.3 2010-09-26 Test::Requires(3)