{"action":"opened","issue":{"number":2,"created_at":"2011-10-26T16:44:22Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"What are your thoughts in cleaning up in a global beforeEach(), rather than in afterEach()?\r\n\r\nMy reasons for desiring this feature:\r\n1) The book \"Growing Object Oriented Software: Guided by Tests\" (aka GOOS) on page 292, discusses tests with databases.  In particular, they recommend cleaning up before each test; and one of their reasons is that they can diagnose failures better.\r\n2) Each test will still start with a clean slate if tidyUp() followed by init() is called in a global beforeEach().\r\n3) I made a local modification to do just this, and it came in handy when diagnosing a nasty bug involving applying $(selector).live() multiple times (in beforeEach()) without calling die().  \r\n\r\nIf people prefer to clean up in afterEach(), this could be a configurable option (which I'm leaning towards).\r\nBy default, it would clean up in afterEach(), but you could configure it to clean up only in beforeEach().\r\n\r\nThe only difficult part would be to spec out this behavior and verifying that the specContainer is still around.\r\n\r\nThoughts?","comments":0,"title":"tidyUp and init() in global beforeEach","updated_at":"2011-10-26T16:44:22Z","url":"https://api.github.com/repos/searls/jasmine-fixture/issues/2","id":2058779,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/5d78498cf014ece6bf3460a4ee40c3b9?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"5d78498cf014ece6bf3460a4ee40c3b9","url":"https://api.github.com/users/kchien","id":140809,"login":"kchien"},"html_url":"https://github.com/searls/jasmine-fixture/issues/2","labels":[],"state":"open"},"legacy":{"number":2,"action":"opened","issue":2058779}}