Skip to content

Instantly share code, notes, and snippets.

@alexyork
Created September 9, 2010 07:59
Show Gist options
  • Save alexyork/571551 to your computer and use it in GitHub Desktop.
Save alexyork/571551 to your computer and use it in GitHub Desktop.
// Jasmine
// http://pivotal.github.com/jasmine/
describe("Calculator", function() {
it("should add two numbers correctly", function() {
var result = add(3, 4);
expect(result).toEqual(7);
});
it("should subtract two numbers correctly", function() {
var result = subtract(8, 3);
expect(result).toEqual(5);
});
});
function add(x, y) {
return x + y;
}
function subtract(x, y) {
return x - y;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment