Permalink
Browse files

failing env test

  • Loading branch information...
1 parent 3b0e51a commit 8f772f6c742d75cbfbdc816aa2c16ae49ae56826 @substack committed Jul 12, 2012
Showing with 28 additions and 0 deletions.
  1. +27 −0 test/env.js
  2. +1 −0 test/foo/config.beep.json
View
27 test/env.js
@@ -0,0 +1,27 @@
+var test = require('tap').test;
+var confuse = require('../');
+var path = require('path');
+
+test('env', function (t) {
+ function config (dir) {
+ return {
+ dir : path.join(__dirname, dir),
+ env : 'beep'
+ };
+ }
+
+ t.same(confuse(config()), {
+ W: 777, q: { w: 7 }, n: 3
+ });
+ t.same(confuse(config('foo')), {
+ W: 777, q: { w: 7, z: 606 }, n: 2, Z: 60606
+ });
+ t.same(confuse(config('foo/bar')), {
+ W: 777, q: { w: 7, z: 6, y: 5 }, n: 1, Z: 666, Y: 555
+ });
+ t.same(confuse(config('foo/bar/baz')), {
+ W: 777, q: { w: 7, z: 606, y: 5, x: 4 }, n: 0,
+ Z: 60606, Y: 555, X: 444
+ });
+ t.end();
+});
View
1 test/foo/config.beep.json
@@ -0,0 +1 @@
+{ "Z" : 60606, "q" : { "z" : 606 }, "n" : 2 }

0 comments on commit 8f772f6

Please sign in to comment.