💄 fix the protocol module spec on OS X.

This commit is contained in:
Cheng Zhao 2013-09-05 18:28:48 +08:00
parent 6a322f8bd6
commit bc9c95d77d

View file

@ -114,8 +114,11 @@ describe 'protocol API', ->
free() free()
assert false, 'Got error: ' + errorType + ' ' + error assert false, 'Got error: ' + errorType + ' ' + error
protocol.interceptProtocol targetScheme, (request) -> protocol.interceptProtocol targetScheme, (request) ->
pathInUrl = path.normalize request.url.substr(8) if process.platform is 'win32'
assert.equal pathInUrl, __filename 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) -> it 'can override original protocol handler', (done) ->
handler = remote.createFunctionWithReturnValue 'valar morghulis' handler = remote.createFunctionWithReturnValue 'valar morghulis'