public
Description: Simple project setup to let you test jsunit, JSSpec and Screw Unit against the same javascript model classes.
Homepage: http://www.brokenbuild.com/blog
Clone URL: git://github.com/wesmaldonado/test-driven-javascript-example-application.git
wesmaldonado (author)
Mon Nov 17 09:57:57 -0800 2008
commit  5a92b0d3baf6e58a10da773ff5a1ad64090670c8
tree    042964d828de81b5677024288ae23dcbb29c403b
parent  b577564cdfa4910933942b2edcfff482a2bd0f93
100644 33 lines (24 sloc) 0.735 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function Cat(name){
this.name = name;
}
 
// cd /Users/wesmaldonado/workspace/tdd-javascript/example-app
// run via: screwserver spec/javascripts/screw-unit/ public/javascripts/ ./public/
Screw.Unit(function(){
 
describe("Cat", function() {
var cat;
before(function() {
cat = new Cat("fluffy");
});
  
it(" should have the right name for fluffy", function(){
expect(cat.name).to(equal, "fluffy");
 
});
 
    it(" should have a name", function(){
       expect("fluffy").to(equal, new Cat("fluffy").name);
    });
 
});
 
describe("dom manipulation", function(){
it("should let you use jQuery to manipulate the dom ", function(){
expect(jQuery('<span>foo</span>').text()).to(equal, "bar");
});
});
});