         throw e
 
     debug.call testedCheck, 'add'
-    debug.call testedCheck, 'push'
-    debug.call testedCheck, 'pop'
     debug.call testedCheck, 'assert'
     testedCheck
 }

  check: (testedCheck) ->
    debug.property testedCheck, 'finish'
    debug.property testedCheck, 'state'
    debug.property testedCheck.state, 'strategy'
    debug.property testedCheck.state, 'result'
    debug.property testedCheck.state, 'current'
    debug.call testedCheck.state.done, 'push'
    testedCheck.push = debug.decorate testedCheck.push, (originalPush)->
      originalPush.call testedCheck
      debug.property testedCheck.state, 'strategy'
      debug.property testedCheck.state, 'result'
      debug.property testedCheck.state, 'current'
      debug.call testedCheck.state.done, 'push'
    testedCheck.add = debug.decorate testedCheck.add, (originalAdd, args...)->
      try
        originalAdd.call testedCheck, args...

Function.prototype.toJSON = -> @name

stack = ""
indent = "      "

log = (arg) -> console.log "#{stack}#{indent}#{arg}"
pass = (arg) -> arg

debug = {
  call: (instance, key, prefix = '#', suffix = '')->
    method = instance[key]
    instance[key] = (args...) ->
      log "#{prefix}#{key}#{suffix}(#{args.map(JSON.stringify).join(',')})"
      indent += "  "
      retVal = method.call instance, args...
      indent = indent.substr 0, indent.length - 2
      if retVal is instance
        log "return this"
      else
        log "return #{JSON.stringify(retVal)}"
      retVal

  property: (instance, key, onSet = pass)->
    value = instance[key]
    Object.defineProperty instance, key,
      get: ->
        value
      set: (arg)->
        log "set #{key}: #{JSON.stringify arg}"
        value = onSet arg
      enumerable: true,
      configurable: true,

