5. Creating your Kit
package MyProject::Test;
use Test::Kit;
# Combine multiple modules' behaviour into one
include 'Test::More';
include 'Test::LongString';
6. Creating your Kit
package MyProject::Test;
use Test::Kit;
# Combine multiple modules' behaviour into one
include 'Test::More';
include 'Test::LongString';
# Exclude or rename exported subs
include 'Test::Warn' => {
exclude => [ 'warning_is' ],
renamed => {
'warning_like' => 'test_warn_warning_like'
},
};
7. Creating your Kit
package MyProject::Test;
use Test::Kit;
# Combine multiple modules' behaviour into one
include 'Test::More';
include 'Test::LongString';
# Exclude or rename exported subs
include 'Test::Warn' => {
exclude => [ 'warning_is' ],
renamed => {
'warning_like' => 'test_warn_warning_like'
},
};
# Pass parameters through to import() directly
include 'List::Util' => {
import => [ 'min', 'max', 'shuffle' ],
};
8. Creating your Kit
package MyProject::Test;
use Test::Kit;
# Combine multiple modules' behaviour into one
include 'Test::More';
include 'Test::LongString';
# Exclude or rename exported subs
include 'Test::Warn' => {
exclude => [ 'warning_is' ],
renamed => {
'warning_like' => 'test_warn_warning_like'
},
};
# Pass parameters through to import() directly
include 'List::Util' => {
import => [ 'min', 'max', 'shuffle' ],
};
10. Using your Kit
use strict;
use warnings;
use MyProject::Test tests => 4;
11. Using your Kit
use strict;
use warnings;
use MyProject::Test tests => 4;
ok 1, "1 is true";
like_string(
`cat /usr/share/dict/words`,
qr/^ kit $/imsx,
"kit is a word"
);
12. Using your Kit
use strict;
use warnings;
use MyProject::Test tests => 4;
ok 1, "1 is true";
like_string(
`cat /usr/share/dict/words`,
qr/^ kit $/imsx,
"kit is a word"
);
test_warn_warning_like {
warn "foo";
}
qr/FOO/i,
"warned foo";
13. Using your Kit
use strict;
use warnings;
use MyProject::Test tests => 4;
ok 1, "1 is true";
like_string(
`cat /usr/share/dict/words`,
qr/^ kit $/imsx,
"kit is a word"
);
test_warn_warning_like {
warn "foo";
}
qr/FOO/i,
"warned foo";
is max(qw(1 2 3 4 5)), 5, 'maximum is 5';
14. Using your Kit
use strict;
use warnings;
use MyProject::Test tests => 4;
ok 1, "1 is true";
like_string(
`cat /usr/share/dict/words`,
qr/^ kit $/imsx,
"kit is a word"
);
test_warn_warning_like {
warn "foo";
}
qr/FOO/i,
"warned foo";
is max(qw(1 2 3 4 5)), 5, 'maximum is 5';