canvas-lms/spec/coffeescripts/invokerSpec.coffee

19 lines
373 B
CoffeeScript

define ['compiled/util/invoker'], (invoker) ->
obj = invoker
one: ->
1
noMethod: ->
'noMethod'
module 'Invoker'
test 'should call a method with invoke', =>
result = obj.invoke 'one'
equal result, 1
test "should call noMethod when invoked method doesn't exist", =>
result = obj.invoke 'non-existent'
equal result, 'noMethod'