Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

passing test for array env

  • Loading branch information...
commit d62471d7ef99f10414208543b52eef940b8237ff 1 parent 3e96f1f
@substack authored
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 }
Please sign in to comment.
Something went wrong with that request. Please try again.