spec: original-fs module

This commit is contained in:
Cheng Zhao 2014-11-12 11:31:31 +08:00
parent 5cb97545fd
commit 90c24de0f0

View file

@ -391,3 +391,17 @@ describe 'asar package', ->
ipc.on 'dirname', (event, dirname) ->
assert.equal dirname, path.dirname(p)
done()
describe 'original-fs module', ->
originalFs = require 'original-fs'
it 'uses the original fs api', ->
changedApis = ['readFile', 'stat', 'lstat', 'realpath', 'exists']
unchangedApis = ['read', 'write', 'writeFile', 'close']
assert.notStrictEqual fs[api], originalFs[api] for api in changedApis
assert.strictEqual fs[api], originalFs[api] for api in unchangedApis
it 'treats .asar as file', ->
file = path.join fixtures, 'asar', 'a.asar'
stats = originalFs.statSync file
assert stats.isFile()