]> khamidou — GitHub mirrors - electron.git/commitdiff
spec: original-fs module
authorCheng Zhao <zcbenz@gmail.com>
Wed, 12 Nov 2014 03:31:31 +0000 (11:31 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 12 Nov 2014 03:31:31 +0000 (11:31 +0800)
spec/asar-spec.coffee

index 12cbff7989ae9363e8c77f88cc986259071580da..b48394f8e21df0c843d3c2e376ea6b6d26e256f1 100644 (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()