Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

quickfixed tests to pass under 0.6 node, just for lulz

  • Loading branch information...
commit 9109cd395f48d8bb6977cb1fd1d4dfef033cf118 1 parent e64186f
@puzrin puzrin authored
Showing with 11 additions and 3 deletions.
  1. +1 −0  .travis.yml
  2. +10 −3 test/fromfile.js
View
1  .travis.yml
@@ -1,5 +1,6 @@
language: node_js
node_js:
+ - 0.6
- 0.8
before_script: "make dev-deps"
script: "make test"
View
13 test/fromfile.js
@@ -16,8 +16,15 @@ _.str = require('underscore.string');
var oldcwd = process.cwd();
function setup_tempdir() {
- // setup a temporary directory as cwd
- var tdir = path.join(os.tmpDir(), 'argparse_temp');
+ // setup a temporary directory:
+ // /tmp/argparse_6732
+ //
+ // For 0.6 node use '/tmp' as workaround for travis-ci
+ var tdir = path.join(
+ os.tmpDir ? os.tmpDir() : '/tmp',
+ 'argparse_' + Math.floor(Math.random() * 10000)
+ );
+
try {
fs.mkdirSync(tdir);
} catch (error) {
@@ -35,7 +42,7 @@ function teardown_tempdir(oldcwd) {
// remove the temp dir
var tdir = process.cwd();
process.chdir(oldcwd);
- if (_.str.startsWith(tdir, os.tmpDir())) {
+ if (_.str.startsWith(tdir, os.tmpDir ? os.tmpDir() : '/tmp')) {
var dirls = fs.readdirSync(tdir);
//console.log(tdir, dirls)
dirls.forEach(function (f) {
Please sign in to comment.
Something went wrong with that request. Please try again.