code: function(name, func) {
        var _test = new Test({
          name: name,
          level: level++
        });
        
        if (this instanceof Test) {
          this.tests.push(_test);
        } else {
          salep.tests.push(_test);
        }
  
        if (salep.isRunning && !skipNextEnabled) {
          testStart(_test);
          func.call(_test);
          _test.cases.forEach(function(_case) {
            if (_case.skipped) {
              skip(_case);
              return;
            } else {
              caseStart(_case);
              try {
                _test.beforeEachCb && _test.beforeEachCb();
                _case.caseFunction && _case.caseFunction();
                _test.afterEachCb && _test.afterEachCb();
  
                _case.success = true;
                success(_case);
              } catch (e) {
                _case.success = false;
                _case.reason = e;
                fail(_case);
              }
            }
          });
        } else {
          _test.skipped = true;
          skipNextEnabled = false;
          skip(_test);
        }
  
        level--;
      }
docs: @method test
  @memberof salep
  
  @desc
  This function creates a new test inside salep scope with given name
  and test function. Tests doesn't have success or fail status, they have
  cases. All the cases written inside test function is belong to named test.
  
  @param {String}    name  Name of the test
  @param {Function}  func  Test function
  
  @fires salep#testStart
  @fires salep#skip
  
  @example
  salep.test('NewTest', function() {
  this.case('NewCase of NewTest', function() {
  // Case code goes here
  });
  });