Skip to content

Commit

Permalink
Merge pull request #36 from bentaber/travis-ci
Browse files Browse the repository at this point in the history
Travis ci
  • Loading branch information
bentaber committed Apr 3, 2013
2 parents c7fcb0d + 8b0175c commit 3950692
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
@@ -0,0 +1,5 @@
language: node_js
node_js:
- "0.10"
- "0.8"
- "0.6"
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -109,6 +109,8 @@ Emitted whenever all records have been written to disk.

## Tests

[![Build Status](https://travis-ci.org/bentaber/node-dirty.png)](https://travis-ci.org/bentaber/node-dirty)

Dirty utilizes the [Mocha](http://visionmedia.github.com/mocha/) test framework.

```bash
Expand Down
17 changes: 13 additions & 4 deletions test/test-api.js
@@ -1,17 +1,26 @@
var config = require('./config');
path = require('path'),
fs = require('fs'),
dirty = require(config.LIB_DIRTY),
events = require('events'),
assert = require('assert');

// exists moved from path to fs in node v0.7.1
// https://raw.github.com/joyent/node/v0.7.1/ChangeLog
var exists = (fs.exists) ? fs.exists : path.exists;

function dirtyAPITests(file) {
var mode = (file) ? 'persistent' : 'transient';

describe('dirty api (' + mode + ' mode)', function() {
function cleanup() {
if (fs.existsSync(file)) {
fs.unlinkSync(file);
}
function cleanup(done) {
exists(file, function(doesExist) {
if (doesExist) {
fs.unlinkSync(file);
}

done();
});
}

before(cleanup);
Expand Down

0 comments on commit 3950692

Please sign in to comment.