-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27fc228
commit 8b73525
Showing
6 changed files
with
22 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- 'iojs' | ||
- 'stable' | ||
- '0.12' | ||
- '0.10' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "[email protected]", | ||
"url": "http://sindresorhus.com" | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
import fs from 'fs'; | ||
import test from 'ava'; | ||
import path from 'path'; | ||
import tempWrite from './'; | ||
import test from 'ava'; | ||
import fn from './'; | ||
|
||
test('tempWrite(string)', async t => { | ||
const filepath = await tempWrite('unicorn', 'test.png'); | ||
const filepath = await fn('unicorn', 'test.png'); | ||
|
||
t.is(fs.readFileSync(filepath, 'utf8'), 'unicorn'); | ||
t.is(path.basename(filepath), 'test.png'); | ||
t.end(); | ||
}); | ||
|
||
test('tempWrite(buffer)', async t => { | ||
const filepath = await tempWrite(new Buffer('unicorn'), 'test.png'); | ||
const filepath = await fn(new Buffer('unicorn'), 'test.png'); | ||
|
||
t.is(fs.readFileSync(filepath, 'utf8'), 'unicorn'); | ||
t.end(); | ||
}); | ||
|
||
test('tempWrite(string, path)', async t => { | ||
const filepath = await tempWrite(new Buffer('unicorn'), 'foo/bar/test.png'); | ||
const filepath = await fn(new Buffer('unicorn'), 'foo/bar/test.png'); | ||
|
||
t.is(fs.readFileSync(filepath, 'utf8'), 'unicorn'); | ||
t.regexTest(/foo\/bar\/test\.png$/, filepath); | ||
t.end(); | ||
}); | ||
|
||
test('tempWrite.sync()', t => { | ||
t.is(fs.readFileSync(tempWrite.sync('unicorn'), 'utf8'), 'unicorn'); | ||
t.is(fs.readFileSync(fn.sync('unicorn'), 'utf8'), 'unicorn'); | ||
t.end(); | ||
}); |