The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::Requires::Env - Testing environments and skipping by result of the testing

SYNOPSIS

  use Test::More;
  use Test::Requires::Env;

  $ENV{SHELL} = '/bin/zsh';

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

  fail 'Do not reach here';

DESCRIPTION

Test::Requires::Env is testing environments and skipping by result 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

Test::Requires

This module is expired Test::Requires.

Test::Skip::UnlessExistsExecutable

LICENSE

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