perltidy
[p5sagit/Config-Any.git] / t / 61-features.t
index b2d8467..c1d983d 100644 (file)
@@ -1,51 +1,54 @@
-package MockApp;\r
-use strict;\r
-use warnings;\r
-\r
-$|++;\r
-\r
-use Test::More tests => 10;\r
-use Scalar::Util qw(blessed reftype);\r
-\r
-use Config::Any;\r
-use Config::Any::INI;\r
-\r
-our $cfg_file = 't/conf/conf.foo';\r
-\r
-eval { Config::Any::INI->load($cfg_file); };\r
-SKIP: {\r
-    skip "File loading backend for INI not found", 9 if $@;\r
-\r
-    ok( my $c_arr = Config::Any->load_files({ \r
-            files           => [ $cfg_file ], \r
-            force_plugins   => [qw(Config::Any::INI)] \r
-        }), "load file with parser forced" );\r
-\r
-    ok(my $c = $c_arr->[0], "load_files returns an arrayref");\r
-    \r
-    ok(ref $c, "load_files arrayref contains a ref");\r
-    my $ref = blessed $c ? reftype $c : ref $c;\r
-    is(substr($ref,0,4), "HASH", "hashref");\r
-\r
-    my ($name, $cfg) = each %$c;\r
-    is($name, $cfg_file, "filename matches");\r
-    \r
-    my $cfgref = blessed $cfg ? reftype $cfg : ref $cfg;\r
-    is(substr($cfgref,0,4), "HASH", "hashref cfg");\r
-\r
-    is( $cfg->{name}, 'TestApp', "appname parses" );\r
-    is( $cfg->{Component}{ "Controller::Foo" }->{ foo }, 'bar',                  \r
-        "component->cntrlr->foo = bar" );\r
-    is( $cfg->{Model}{ "Model::Baz" }->{ qux },                 'xyzzy',                 \r
-        "model->model::baz->qux = xyzzy" );\r
-\r
-\r
-    ok( my $c_arr_2 = Config::Any->load_files({ \r
-            files           => [ $cfg_file ], \r
-            force_plugins   => [qw(Config::Any::INI)],\r
-            use_ext         => 1\r
-        }), "load file with parser forced" );\r
-}\r
-\r
-\r
-\r
+package MockApp;
+use strict;
+use warnings;
+
+$|++;
+
+use Test::More tests => 10;
+use Scalar::Util qw(blessed reftype);
+
+use Config::Any;
+use Config::Any::INI;
+
+our $cfg_file = 't/conf/conf.foo';
+
+eval { Config::Any::INI->load( $cfg_file ); };
+SKIP: {
+    skip "File loading backend for INI not found", 10 if $@;
+
+    ok( my $c_arr = Config::Any->load_files(
+            {   files         => [ $cfg_file ],
+                force_plugins => [ qw(Config::Any::INI) ]
+            }
+        ),
+        "load file with parser forced"
+    );
+
+    ok( my $c = $c_arr->[ 0 ], "load_files returns an arrayref" );
+
+    ok( ref $c, "load_files arrayref contains a ref" );
+    my $ref = blessed $c ? reftype $c : ref $c;
+    is( substr( $ref, 0, 4 ), "HASH", "hashref" );
+
+    my ( $name, $cfg ) = each %$c;
+    is( $name, $cfg_file, "filename matches" );
+
+    my $cfgref = blessed $cfg ? reftype $cfg : ref $cfg;
+    is( substr( $cfgref, 0, 4 ), "HASH", "hashref cfg" );
+
+    is( $cfg->{ name }, 'TestApp', "appname parses" );
+    is( $cfg->{ Component }{ "Controller::Foo" }->{ foo },
+        'bar', "component->cntrlr->foo = bar" );
+    is( $cfg->{ Model }{ "Model::Baz" }->{ qux },
+        'xyzzy', "model->model::baz->qux = xyzzy" );
+
+    ok( my $c_arr_2 = Config::Any->load_files(
+            {   files         => [ $cfg_file ],
+                force_plugins => [ qw(Config::Any::INI) ],
+                use_ext       => 1
+            }
+        ),
+        "load file with parser forced"
+    );
+}
+