Module::Install::TestVars - Setting and Passing test variables.
In your Makefile.PL,
use inc::Module::Install; test_vars TEST_DBI_DSN => +{ default => 'dbi:mysql:dbname=test', prompt => 'input DBI DSN param' }, TEST_DBI_USER => +{ default => 'root', prompt => 'input DBI USER param', }, TEST_DBI_PASSWORD => +{ default => '', prompt => 'input DBI PASSWORD param', };
Running Makefile.PL, asking values and passing variables to tests.
In your test,
use Test::More tests => 1; diag($ENV{TEST_DBI_DSN}); # 'dbi:mysql:dbname=test' diag($ENV{TEST_DBI_USER}); # 'root' diag($ENV{TEST_DBI_PASSWORD}); # '' ok(1);
Module::Install::TestVars is module asking and setting test variable. Please see unit tests for usage details.
key-setting.
Toru Yamaguchi <zigorou@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Module::Install::TestVars, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Module::Install::TestVars
CPAN shell
perl -MCPAN -e shell install Module::Install::TestVars
For more information on module installation, please visit the detailed CPAN module installation guide.