| Test-Env documentation | Contained in the Test-Env distribution. |
Test::Env - test the environment
use Test::More tests => 1; use Test::Env; env_ok( 'PERL5LIB', "./blib/lib" );
Ok if the environment variable NAME is VALUE.
This source is part of a SourceForge project which always has the latest sources in CVS, as well as all of the previous releases.
http://sourceforge.net/projects/brian-d-foy/
If, for some reason, I disappear from the world, one of the other members of the project can shepherd this module appropriately.
brian d foy, <bdfoy@cpan.org>
Copyright (c) 2002-2007 brian d foy. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Test-Env documentation | Contained in the Test-Env distribution. |
# $Id: Env.pm 2299 2007-08-13 02:47:06Z comdog $ package Test::Env; use strict; use base qw(Exporter); use vars qw(@EXPORT $VERSION); @EXPORT = qw(env_ok); $VERSION = 1.08; use Test::Builder; my $Test = Test::Builder->new();
sub env_ok($$) { my $name = shift; my $value = shift; unless( exists $ENV{$name} ) { $Test->ok(0); $Test->diag( "Environment variable [$name] missing!\n", "\tExpected [$value]\n" ); } elsif( $ENV{$name} ne $value ) { $Test->ok(0); $Test->diag( "Environment variable [$name] has wrong value!\n", "\tExpected [$value]\n", "\tGot [$ENV{$name}]\n" ); } else { $Test->ok(1); } }
"Roscoe";