Showing 179 scripts

Sort by name or size

js-spec

js-spec

Want to do BDD in Javascript? This aims to clone rspec (http://rspec.rubyforge.org) in javascript. For now it's very basic, but stuff like the following works.


describe("A newly created Tic-Tac-Toe", function() {
  with (this) {
    before("each", function() {
      this.game = new TicTacToe();
    });
	
    it("should have 9 empty cells", function() {
      game.cells.should( have(9, "items") );
      game.cells.each(function(cell) {
        cell.should( be(undefined) );
      });
    });
	
    it("should have 0 players", function() {
      game.should( have(0, "players") );
    });
  }
});

Stay tuned for more :) Ask questions, make suggestions and post bugs at http://code.google.com/p/js-spec/issues/
Website:
js-spec
Author:
foca
Size:
11.7 KB
Last modified:
12/21/2007
License:
MIT
Tags:
syntactic sugar, testing
Rating:
4
(4/5 from 3 votes)
Your rating:
Please sign in or register to rate this script
Select multiple tags with Ctrl+click (Cmd+click on Mac)

Found a bug or have a suggestion?Let us know

bitsonnet corp · © 2007-2014 · all rights reserved

Sign In / Register / Forgot password