Man of Honour
Does anyone have to use Capybara for testing?
I wrote some tests and then had a "cleanup" section at the start, which checks for anything that was generated during the previous run and deletes it before the main test that follows attempts to recreate it.
If the test(s) run successfully they will be deleted anyway, but if for some reason the tests fails, because something wasn't found, for example then that bit of code won't be executed.
I've been told I should put it in an after all: hook to make it clean up at the end... but that doesn't seem to work if the test bombs out early...
Am I doing it wrong or is that just how it works?
I wrote some tests and then had a "cleanup" section at the start, which checks for anything that was generated during the previous run and deletes it before the main test that follows attempts to recreate it.
If the test(s) run successfully they will be deleted anyway, but if for some reason the tests fails, because something wasn't found, for example then that bit of code won't be executed.
I've been told I should put it in an after all: hook to make it clean up at the end... but that doesn't seem to work if the test bombs out early...
Am I doing it wrong or is that just how it works?