"use strict";

exports.tryCatch = function (done, func) {
  try {
    func();
    done();
  } catch (err) {
    done(err);
  }
};

@@ -8,16 +8,93 @@
 rict%22;%0A%0A
+var blessed = require(%22blessed%22);%0Avar contrib = require(%22blessed-contrib%22);%0A%0A
 exports.
@@ -200,8 +200,792 @@
 %0A  %7D%0A%7D;%0A
+%0Aexports.getTestContainer = function (sandbox) %7B%0A  var mockScreen = %7B%0A    on: sandbox.stub(),%0A    append: sandbox.stub(),%0A    remove: sandbox.stub(),%0A    type: %22screen%22,%0A    setEffects: sandbox.stub(),%0A    _events: %7B%7D,%0A    clickable: %5B%5D,%0A    keyable: %5B%5D,%0A    rewindFocus: sandbox.stub(),%0A    _listenKeys: sandbox.stub(),%0A    _listenMouse: sandbox.stub()%0A  %7D;%0A  var container = blessed.box(%7B parent: mockScreen %7D);%0A  sandbox.stub(container, %22render%22);%0A  return container;%0A%7D;%0A%0A// stub functions that require an active screen%0Aexports.stubWidgets = function (sandbox) %7B%0A  sandbox.stub(blessed.element.prototype, %22setContent%22);%0A  sandbox.stub(blessed.element.prototype, %22setLabel%22);%0A  sandbox.stub(contrib.line.prototype, %22setData%22);%0A  sandbox.stub(contrib.gauge.prototype, %22setData%22);%0A%7D;%0A

test util for creating mock container/screen