Test::BDD::Infrastructure::Config - configuration variables support for Test::BDD::Infrastructure
version 1.005
The module provides a abstraction to retrieve configuration values from different configuration backends.
Load a configuration in step_files/00use_steps.pl:
use Test::BDD::Infrastructure::Config; my $c = Test::BDD::Infrastructure::Config->new; $c->load_config( dirname(__FILE__)."/config.yaml" );
Or register additional configuration backends:
use Test::BDD::Infrastructure::Config::Augeas; use Test::BDD::Infrastructure::Config::Facter; $c->register_config( 'a' => Test::BDD::Infrastructure::Config::Facter->new, );
In config.yaml:
web: baseurl: http://www.example.tld/
Then retrieve the value with:
$c->get( 'c', 'web/baseurl');
Or to retrieve a value from the Augeas backend:
$c->get( 'a', '/files/etc/resolv.conf/nameserver');
Registers a new configuration backend.
Unregisters the backend in $scope.
Unregisters all configuration backends.
This is an alias for loading a YAML file to the scope 'c':
$config->register_config( 'c' => Test::BDD::Infrastructure::Config::YAML->new( file => $file, ) );
Retrieve a node within the configuration tree with all its subentries.
Retrieve a configuration value.
Test::BDD::Infrastructure::Config::YAML, Test::BDD::Infrastructure::Config::Augeas, Test::BDD::Infrastructure::Config::Facter
Markus Benning <ich@markusbenning.de>
This software is copyright (c) 2015 by Markus Benning.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Test::BDD::Infrastructure, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::BDD::Infrastructure
CPAN shell
perl -MCPAN -e shell install Test::BDD::Infrastructure
For more information on module installation, please visit the detailed CPAN module installation guide.