frankendoc
Version:
bringing documents alive
59 lines (37 loc) • 1.33 kB
text/coffeescript
_ = require 'underscore'
{ MethodMatcher } = require './method_matcher'
result = require './result'
class
constructor: ->
= new MethodMatcher
run_steps: (, steps) ->
try
process.on 'uncaughtException',
= []
step for step in steps
finally
process.removeListener 'uncaughtException',
run_step: () ->
return unless
return unless
try
if then .async_call() else
catch e
e
pending: -> .push result.pending ,
pass: -> .push result.passed
fail: (e) -> .push result.failed , e
exception: (e) => e
is_defined: ->
return true if Sut
return true for sut in when global[sut]
false
matched: () -> .match ,
method: -> .method
is_implemented: -> _.isFunction
is_async: -> .length is .args.length + 1
sync_call: -> .args
async_call: () -> .args.concat []
call: (args) -> .apply , args