0.05 Wed Feb 21 22:00:00 2007
- added support for (requested by Evan Kaufman):
+ 'force_plugins => [ qw(Config::Any::Foo Config::Any::Blah) ]' parameter
- to load_(files|stems)
+ to load_(files|stems)
+ $Config::Any::INI::MAP_SECTION_SPACE_TO_NESTED_KEY - boolean, defaulting
to on, controlling whether to map spaces in INI section headings
to nested hashrefs
# test invalid config
{
- my $file = 't/invalid/conf.conf';
+ my $file = 't/invalid/conf.conf';
my $config = eval { Config::Any::General->load( $file ) };
ok( !$config, 'config load failed' );
- ok( $@, "error thrown ($@)" );
+ ok( $@, "error thrown ($@)" );
}
# test invalid config
{
- my $file = 't/invalid/conf.ini';
+ my $file = 't/invalid/conf.ini';
my $config = eval { Config::Any::INI->load( $file ) };
ok( !$config, 'config load failed' );
- ok( $@, "error thrown ($@)" );
+ ok( $@, "error thrown ($@)" );
}
# test invalid config
{
- my $file = 't/invalid/conf.json';
+ my $file = 't/invalid/conf.json';
my $config = eval { Config::Any::JSON->load( $file ) };
ok( !$config, 'config load failed' );
- ok( $@, "error thrown ($@)" );
+ ok( $@, "error thrown ($@)" );
}
# test invalid config
{
- my $file = 't/invalid/conf.pl';
+ my $file = 't/invalid/conf.pl';
my $config = eval { Config::Any::Perl->load( $file ) };
ok( !$config, 'config load failed' );
- ok( $@, "error thrown ($@)" );
+ ok( $@, "error thrown ($@)" );
}
# test invalid config
{
- my $file = 't/invalid/conf.xml';
+ my $file = 't/invalid/conf.xml';
my $config = eval { Config::Any::XML->load( $file ) };
ok( !$config, 'config load failed' );
- ok( $@, "error thrown ($@)" );
+ ok( $@, "error thrown ($@)" );
}
# test invalid config
{
- my $file = 't/invalid/conf.yml';
+ my $file = 't/invalid/conf.yml';
my $config = eval { Config::Any::YAML->load( $file ) };
ok( !$config, 'config load failed' );
- ok( $@, "error thrown ($@)" );
+ ok( $@, "error thrown ($@)" );
}
SKIP: {
skip "File loading backend for INI not found", 14 if $@;
- my $struct; # used to make sure parsing works for arrays and hashes
+ my $struct; # used to make sure parsing works for arrays and hashes
# force_plugins
{
my $ref = blessed $result ? reftype $result : ref $result;
is( substr( $ref, 0, 4 ), 'HASH', 'hashref' );
- is_deeply( $result, $struct, 'load_files return an hashref (flatten_to_hash)' );
+ is_deeply( $result, $struct,
+ 'load_files return an hashref (flatten_to_hash)' );
}
-
- # use_ext
+
+ # use_ext
{
ok( my $result = Config::Any->load_files(
{ files => [ $cfg_file ],
-name = TestApp\r
-<Component Controller::Foo>\r
- foo bar\r
-</Component>\r
-<Model Model::Baz>\r
- qux xyzzy\r
-</Model>\r
+name = TestApp
+<Component Controller::Foo>
+ foo bar
+</Component>
+<Model Model::Baz>
+ qux xyzzy
+</Model>
-name=TestApp\r
- \r
-[Component Controller::Foo]\r
-foo=bar\r
-\r
-[Model Model::Baz]\r
-qux=xyzzy\r
+name=TestApp
+
+[Component Controller::Foo]
+foo=bar
+
+[Model Model::Baz]
+qux=xyzzy
-name=TestApp\r
- \r
-[Component Controller::Foo]\r
-foo=bar\r
-\r
-[Model Model::Baz]\r
-qux=xyzzy\r
+name=TestApp
+
+[Component Controller::Foo]
+foo=bar
+
+[Model Model::Baz]
+qux=xyzzy
-{\r
- "name": "TestApp",\r
- "Component": {\r
- "Controller::Foo": {\r
- "foo": "bar"\r
- }\r
- },\r
- "Model": {\r
- "Model::Baz": {\r
- "qux": "xyzzy"\r
- }\r
- }\r
-}\r
+{
+ "name": "TestApp",
+ "Component": {
+ "Controller::Foo": {
+ "foo": "bar"
+ }
+ },
+ "Model": {
+ "Model::Baz": {
+ "qux": "xyzzy"
+ }
+ }
+}
-name=TestApp\r
- \r
-[Controller::Foo]\r
-foo=bar\r
-\r
-[Model::Baz]\r
-qux=xyzzy\r
+name=TestApp
+
+[Controller::Foo]
+foo=bar
+
+[Model::Baz]
+qux=xyzzy
-name = TestApp\r
-<Component Controller::Foo\r
- foo bar\r
-</Component>\r
-<Model Model::Baz>\r
- qux xyzzy\r
-</Model>\r
+name = TestApp
+<Component Controller::Foo
+ foo bar
+</Component>
+<Model Model::Baz>
+ qux xyzzy
+</Model>
-name=TestApp\r
- \r
-[Component Controller::Foo\r
-foo=bar\r
-\r
-[Model Model::Baz]\r
-qux=xyzzy\r
+name=TestApp
+
+[Component Controller::Foo
+foo=bar
+
+[Model Model::Baz]
+qux=xyzzy
-{\r
- "name": "TestApp",\r
- "Component": {\r
- "Controller::Foo": {\r
- "foo": "bar"\r
- }\r
- },\r
- "Model": {\r
- "Model::Baz": {\r
- "qux": "xyzzy"\r
- }\r
- }\r
+{
+ "name": "TestApp",
+ "Component": {
+ "Controller::Foo": {
+ "foo": "bar"
+ }
+ },
+ "Model": {
+ "Model::Baz": {
+ "qux": "xyzzy"
+ }
+ }