Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

passing deep tests

  • Loading branch information...
commit ea1906d3961e01bfd29323209e03f54c4cea8c11 1 parent d92b7c3
@substack authored
Showing with 45 additions and 0 deletions.
  1. +40 −0 test/deep.js
  2. +5 −0 test/deep.json
View
40 test/deep.js
@@ -0,0 +1,40 @@
+var test = require('tap').test;
+var figc = require('../');
+
+test('deep', function (t) {
+ t.deepEqual(
+ figc(__dirname + '/deep.json', [ '--foo.x', '5' ]),
+ {
+ beep : 'boop',
+ foo : {
+ bar : { baz : 'quux' },
+ x : 5,
+ },
+ xs : [ 1, 2, 3 ]
+ }
+ );
+
+ t.deepEqual(
+ figc(__dirname + '/deep.json', [ '--xs.1', '22' ]),
+ {
+ beep : 'boop',
+ foo : {
+ bar : { baz : 'quux' },
+ },
+ xs : [ 1, '22', 3 ]
+ }
+ );
+
+ t.deepEqual(
+ figc(__dirname + '/deep.json', [ '--beep', 'o_O' ]),
+ {
+ beep : 'o_O',
+ foo : {
+ bar : { baz : 'quux' },
+ },
+ xs : [ 1, 2, 3 ]
+ }
+ );
+
+ t.end();
+});
View
5 test/deep.json
@@ -0,0 +1,5 @@
+{
+ "beep" : "boop",
+ "foo" : { "bar" : { "baz" : "quux" } },
+ "xs" : [ 1, 2, 3 ]
+}
Please sign in to comment.
Something went wrong with that request. Please try again.