Skip to content

Commit

Permalink
test for functional env expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed May 13, 2013
1 parent f6f8bd6 commit 666395f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/env_fn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var test = require('tape');
var parse = require('../').parse;

test('functional env expansion', function (t) {
t.plan(2);

t.same(parse('a $XYZ c', getEnv), [ 'a', 'xxx', 'c' ]);
t.same(parse('a $XYZ c', getEnvObj), [ 'a', { op: '@@' }, 'c' ]);

function getEnv (key) {
return 'xxx';
}

function getEnvObj (key) {
return { op: '@@' };
}
});

0 comments on commit 666395f

Please sign in to comment.