mirror of
https://github.com/HackPlan/atom-shell.git
synced 2026-04-28 11:46:30 +08:00
Remember registered schemes.
This commit is contained in:
15
spec/api/protocol.coffee
Normal file
15
spec/api/protocol.coffee
Normal file
@@ -0,0 +1,15 @@
|
||||
assert = require 'assert'
|
||||
protocol = require('remote').require 'protocol'
|
||||
|
||||
describe 'protocol API', ->
|
||||
describe 'protocol.registerProtocol', ->
|
||||
it 'throws error when scheme is already registered', ->
|
||||
register = -> protocol.registerProtocol('test', ->)
|
||||
register()
|
||||
assert.throws register, /The scheme is already registered/
|
||||
protocol.unregisterProtocol 'test'
|
||||
|
||||
describe 'protocol.unregisterProtocol', ->
|
||||
it 'throws error when scheme does not exist', ->
|
||||
unregister = -> protocol.unregisterProtocol 'test'
|
||||
assert.throws unregister, /The scheme has not been registered/
|
||||
Reference in New Issue
Block a user