Skip to content

Commit

Permalink
Rebase checks. That will be its own module eventually.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Oct 13, 2010
1 parent cf14e87 commit b8689ac
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ exports.checkFail = function (assert) {
});
};

exports.rebase = function (assert) {
assert.equal(
optimist.rebase('/home/substack', '/home/substack/foo/bar/baz'),
'./foo/bar/baz'
);
assert.equal(
optimist.rebase('/home/substack/foo/bar/baz', '/home/substack'),
'../../..'
);
assert.equal(
optimist.rebase('/home/substack/foo', '/home/substack/pow/zoom.txt'),
'../pow/zoom.txt'
);
};

function checkUsage (f) {
var _process = process;
process = Hash.copy(process);
Expand Down

0 comments on commit b8689ac

Please sign in to comment.