Skip to content
Browse files

Add tests for both before and after callbacks in the same describe

  • Loading branch information...
1 parent f32eb2c commit 3f0b33f67cb8043d4489fa27ece6ba6374f26c23 @joshuaclayton committed
Showing with 15 additions and 0 deletions.
  1. +15 −0 specit.tests.js
View
15 specit.tests.js
@@ -231,3 +231,18 @@ describe("SpecIt with an after callback", function() {
equals(changedFromAfterCallback, "changed");
});
});
+
+describe("SpecIt handling before and after", function() {
+ before(function() { $("body").append("<div id='crazy'>"); });
+ after (function() { $("#crazy").remove(); });
+
+ it("should run before callbacks correctly", function() {
+ $("#crazy").html("awesome div");
+ $("#crazy:contains(awesome div)").should(beOnThePage);
+ });
+
+ it("should run after callbacks correctly", function() {
+ $("#crazy").length.should(eql, 1);
+ $("#crazy:contains(awesome div)").shouldNot(beOnThePage);
+ });
+});

0 comments on commit 3f0b33f

Please sign in to comment.
Something went wrong with that request. Please try again.