]> khamidou — GitHub mirrors - electron.git/commitdiff
:lipstick: fix spec failure caused by win32 path delimiter.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 5 Sep 2013 04:24:08 +0000 (12:24 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 5 Sep 2013 04:24:08 +0000 (12:24 +0800)
spec/api/protocol.coffee

index 2a2c8175fbbd7a055d3d49a5e54a4bcee8c67c3c..0f3176da22a0f5e20f33264311c9cee90feedf78 100644 (file)
@@ -1,5 +1,6 @@
 assert = require 'assert'
 ipc = require 'ipc'
+path = require 'path'
 remote = require 'remote'
 protocol = remote.require 'protocol'
 
@@ -113,7 +114,8 @@ describe 'protocol API', ->
             free()
             assert false, 'Got error: ' + errorType + ' ' + error
       protocol.interceptProtocol targetScheme, (request) ->
-        assert.equal request.url, "#{targetScheme}://#{__filename}"
+        pathInUrl = path.normalize request.url.substr(8)
+        assert.equal pathInUrl, __filename
 
     it 'can override original protocol handler', (done) ->
       handler = remote.createFunctionWithReturnValue 'valar morghulis'