Browse files

passing test for array env

  • Loading branch information...
1 parent 3e96f1f commit d62471d7ef99f10414208543b52eef940b8237ff @substack committed Jul 12, 2012
Showing with 26 additions and 0 deletions.
  1. +24 −0 test/env.js
  2. +1 −0 test/foo/bar/config.boop.json
  3. +1 −0 test/foo/config.boop.json
View
24 test/env.js
@@ -25,3 +25,27 @@ test('env', function (t) {
});
t.end();
});
+
+test('array env', function (t) {
+ function config (dir) {
+ return {
+ dir : path.join(__dirname, dir),
+ env : [ 'boop', 'beep' ]
+ };
+ }
+
+ t.same(confuse(config()), {
+ W: 777, q: { w: 7 }, n: 3
+ });
+ t.same(confuse(config('foo')), {
+ W: 777, q: { w: 7, z: 616 }, n: 2, Z: 61616
+ });
+ t.same(confuse(config('foo/bar')), {
+ W: 777, q: { w: 7, z: 616, y: 5.5 }, n: 1, Z: 61616, Y: 555
+ });
+ t.same(confuse(config('foo/bar/baz')), {
+ W: 777, q: { w: 7, z: 616, y: 5.5, x: 4 }, n: 0,
+ Z: 61616, Y: 555, X: 444
+ });
+ t.end();
+});
View
1 test/foo/bar/config.boop.json
@@ -0,0 +1 @@
+{ "Y" : 555, "q" : { "y" : 5.5 }, "n" : 1 }
View
1 test/foo/config.boop.json
@@ -0,0 +1 @@
+{ "Z" : 61616, "q" : { "z" : 616 }, "n" : 2 }

0 comments on commit d62471d

Please sign in to comment.