Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

failing env test

  • Loading branch information...
commit 8f772f6c742d75cbfbdc816aa2c16ae49ae56826 1 parent 3b0e51a
James Halliday authored
Showing with 28 additions and 0 deletions.
  1. +27 −0 test/env.js
  2. +1 −0  test/foo/config.beep.json
27 test/env.js
View
@@ -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();
+});
1  test/foo/config.beep.json
View
@@ -0,0 +1 @@
+{ "Z" : 60606, "q" : { "z" : 606 }, "n" : 2 }
Please sign in to comment.
Something went wrong with that request. Please try again.