Created
January 17, 2011 14:36
-
-
Save craftgear/782905 to your computer and use it in GitHub Desktop.
Inspired by https://github.com/mileskin/zombie-jasmine-spike/blob/master/spec/js/acceptance/foo-twitter-client-spec.js and http://higelog.brassworks.jp/?p=1031
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// install "jasmine-node" | |
// copy "specs.js" file and "lib/" directory to your project directory | |
// make "spec" dir | |
// put your spec files in "spec" directory | |
// run spec "node specs.js" | |
//an example spec file | |
var sys, zombie; | |
zombie = require('zombie'); | |
sys = require('sys'); | |
describe("some controller spec", function() { | |
it('responds 200 OK', function() { | |
zombie.visit('http://localhost:3000/', function(err, browser) { | |
expect(browser.lastResponse.status).toEqual(200); | |
//This method is a part of jasmine-node | |
asyncSpecDone(); | |
}); | |
}); | |
it('title should be Node.js Rocks!', function() { | |
zombie.visit('http://localhost:3000/', function(err, browser) { | |
expect(browser.text('title')).toEqual('Node.js Rocks!'); | |
//This method is a part of jasmine-node as well. | |
asyncSpecDone(); | |
}); | |
}); | |
afterEach(function() { | |
//So is this. | |
asyncSpecWait(); | |
}); | |
}); | |
//jasmine-node is great. Thanks, authors! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment