Skip to content

Instantly share code, notes, and snippets.

@theleoborges
Created January 22, 2011 05:01
Show Gist options
  • Save theleoborges/790873 to your computer and use it in GitHub Desktop.
Save theleoborges/790873 to your computer and use it in GitHub Desktop.
are_you_testing_your_javascript_yet#1
Screw.Unit(function() {
describe("Greeter", function() {
it("should say Hi", function() {
greeter = new Greeter();
expect(greeter.greet()).to(equal, "Hi");
});
it("should render the message 'Hi there' inside the container div", function() {
dom_test = $('#dom_test');
dom_test.html("");
greeter = new Greeter();
greeter.render_hi('#container');
expect($('#container').text()).to(equal, "Hi there!");
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment