public
Description: Shoulda for JavaScript
Homepage: http://jshoulda.scriptia.net
Clone URL: git://github.com/choan/jshoulda.git
Click here to lend your support to: jshoulda and make a donation at www.pledgie.com !
commit  bd193d7294fa64a3d186468fe27da4d08e78d899
tree    780949c7e5f18be2dc6cf3c9b0245fb2d406b4d0
parent  116a55e6366134e87a3b2958d4e546731376c264
name age message
file .gitignore Loading commit data...
file .gitmodules Thu Oct 23 15:42:36 -0700 2008 jshoulda.tmbundle as a submodule [choan]
file History.txt
file License.txt Tue Oct 07 14:56:16 -0700 2008 Import from mercurial repository [choan]
file README.mdown
file Rakefile
directory config/ Tue Oct 07 14:56:16 -0700 2008 Import from mercurial repository [choan]
directory dist/
submodule jshoulda.tmbundle - b037257
directory lib/ Sun Nov 09 09:35:54 -0800 2008 Aliasing methods completed [choan]
directory script/ Tue Oct 07 14:56:16 -0700 2008 Import from mercurial repository [choan]
directory site/
directory src/
directory tasks/
directory test/
README.mdown

jShoulda

jShoulda is a wrapper for JsUnitTest which allows the developer to write Shoulda-like tests.

Please visit http://jshoulda.scriptia.net for more information.

Example

context('A context', {
  setup: function() {
    // do your setup
    this.something = 1
  },
  teardown: function() {
    // do your cleaning
  }
  },
  should('run its setup function', function() {
    this.assertEqual(1, this.something);
  }),
  context('which is an inner context', function() {
    setup: function() {
      this.something += 1;
    }
    },
    should('run both setup functions', function() {
      this.assertEqual(2, this.something);
    })
  )
)();

Author, license, source code

jShoulda has been created by Choan Galvez and is freely distributable under the terms of a MIT-style license. The source code resides in a Git repository at github.