NAME

Test::Requires::Env -

SYNOPSIS

use Test::Requires::Env;

test_requires(
  'HOME',
  'PATH',
  +{
    'SHELL'   => '/bin/bash',
    'INCLUDE' => qr{/usr/local/include},
    'LIB'     => qr{/usr/local/lib},
  },
);

DESCRIPTION

Test::Requires::Env is testing environments and skipping by condition of the testing. This module exports 'test_environments()' sub routine.

The sub routine accepts two type arguments. One of them is array of environment names, it is used to check existing such a environment. Other one is hash reference of environment conditions, it is used to check environment value by equals or regexp.

And this module provides short cut of test_environments() sub routine by import method looks like synopsis.

FUNCTIONS

test_environments( @entries )

@entries items should be scalar or hash reference. The scalar is treated as environment name, and check which the specified environment is existing or not in environments.

The hash reference is consisted of environment name is key, environment value condition is value. The environment value condition accepts scalar and regexp.

The condition scalar is used by which the scalar equals actual environment value or not. The condition regexp is used by matching to actual environment value.

AUTHOR

Toru Yamaguchi <zigorou@cpan.org>

SEE ALSO

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.