:lipstick: fix the protocol module spec on OS X.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 5 Sep 2013 10:28:48 +0000 (18:28 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 5 Sep 2013 10:28:48 +0000 (18:28 +0800)
spec/api/protocol.coffee

index 0f3176d..9459d33 100644 (file)
@@ -114,8 +114,11 @@ describe 'protocol API', ->
             free()
             assert false, 'Got error: ' + errorType + ' ' + error
       protocol.interceptProtocol targetScheme, (request) ->
-        pathInUrl = path.normalize request.url.substr(8)
-        assert.equal pathInUrl, __filename
+        if process.platform is 'win32'
+          pathInUrl = path.normalize request.url.substr(8)
+          assert.equal pathInUrl, __filename
+        else
+          assert.equal request.url, "#{targetScheme}://#{__filename}"
 
     it 'can override original protocol handler', (done) ->
       handler = remote.createFunctionWithReturnValue 'valar morghulis'