Sha256: 5bfd8a1ee97d1a02c708b4e592f66cd6daeac247bc645c76357c0ab1757f251e

Contents?: true

Size: 1.04 KB

Versions: 7

Compression:

Stored size: 1.04 KB

Contents

__loading__ = []
__loadDelay__ = 1000

readFile = function(path, callback) {
  __loading__.push(path)
  var promise = node.fs.cat(path, "utf8")
  promise.addErrback(function(){ throw "failed to read file `" + path + "'" })
  promise.addCallback(function(contents){
    setTimeout(function(){
      if (__loading__[0] == path)
        __loading__.shift(), callback(contents)
      else
        setTimeout(arguments.callee, 50)
    }, 50)
  })  
}

load = function(path) {
  readFile(path, function(contents){
    eval(contents)
  })
}

load('lib/jspec.js')
load('spec/modules.js')
load('spec/spec.grammar-less.js')

setTimeout(function(){
  JSpec
  .exec('spec/spec.grammar.js')
  .exec('spec/spec.js')
  .exec('spec/spec.matchers.js')
  .exec('spec/spec.utils.js')
  .exec('spec/spec.shared-behaviors.js')
  .exec('spec/spec.modules.js')
  setTimeout(function(){ 
    JSpec.run({ formatter : JSpec.formatters.Terminal, failuresOnly : true })
    setTimeout(function() {
      JSpec.report()
    }, __loadDelay__ / 3)
  }, __loadDelay__ / 3)
}, __loadDelay__ / 3)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
visionmedia-jspec-2.5.1 spec/spec.node.js
visionmedia-jspec-2.6.0 spec/spec.node.js
visionmedia-jspec-2.7.0 spec/spec.node.js
visionmedia-jspec-2.7.1 spec/spec.node.js
visionmedia-jspec-2.7.2 spec/spec.node.js
visionmedia-jspec-2.8.1 spec/spec.node.js
visionmedia-jspec-2.8.2 spec/spec.node.js