Sha256: 59867882efbf1085678fa2003313a437b57c367152188d8b8500da8469984712

Contents?: true

Size: 640 Bytes

Versions: 5

Compression:

Stored size: 640 Bytes

Contents

Shuriken.Test = {}

((test) ->

  class test.Context
    
    constructor: (name) ->
      @name:   name
      @blocks: {}
    
    blocksFor: (name) ->
      @blocks[name]?= []
      
    invokeBlocksFor: (name) ->
      block() for block in @blocksFor name
    
    run: ->
      @invokeBlocksFor "beforeAll"
      for test in blocksFor "tests"
        @invokeBlocksFor "setup"
        test.run()
        @invokeBlocksFor "teardown"
      @invokeBlocksFor "afterAll"
      
  class test.Test
    
    constructor: (name, body) ->
      @name: name
      @body: body
      
    run: ->
      @body()
      "Passed"
      

)(Shuriken.Test)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
shuriken-0.1.2.2 wip-coffeescripts/test.coffee
shuriken-0.1.2.1 wip-coffeescripts/test.coffee
shuriken-0.1.2 wip-coffeescripts/test.coffee
shuriken-0.1.1 wip-coffeescripts/test.coffee
shuriken-0.1.0 wip-coffeescripts/test.coffee