protocol: wrapping httpjobfactory with a default protocol handler to intercept

This commit is contained in:
deepak1556 2015-05-07 01:45:56 +05:30
parent e5380fd671
commit 7fee639edf
5 changed files with 62 additions and 0 deletions

View file

@ -190,3 +190,10 @@ describe 'protocol module', ->
assert false, 'Got error: ' + errorType + ' ' + error
free()
protocol.interceptProtocol 'file', handler
it 'can override http protocol handler', (done) ->
handler = remote.createFunctionWithReturnValue 'valar morghulis'
protocol.once 'intercepted', ->
protocol.uninterceptProtocol 'http'
done()
protocol.interceptProtocol 'http', handler