Created
June 10, 2010 13:07
-
-
Save sdepold/432965 to your computer and use it in GitHub Desktop.
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
describe("before", function() { | |
before(function() { | |
var hash = {a: 1} | |
var foo = "a" | |
}) | |
it("should correctly use before", function() { | |
expect(hash).toMatch({a: 1}) // will be true | |
hash.a = 2 | |
expect(hash).toMatch({a: 2}) // will be true | |
}) | |
it("should have a new hash instance", function() { | |
expect(hash).toMatch({a: 1}) // will be true | |
}) | |
}) | |
describe("after", function() { | |
after(function() { | |
expect(toBeTested).toEqual(1) | |
}) | |
it("should succeed", function() { | |
var toBeTested = 1 // will be true in the after filter | |
}) | |
it("should fail", function() { | |
var toBeTested = 2 // will fail in the after filter | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment