tdd - Database integration tests -
when doing integration tests either data access layer or majority of application stack. best way prevent multiple tests clashing each other if run on same database?
transactions.
what ruby on rails unit test framework this:
load fixture data. each test: begin transaction # yield control user code rollback transaction end each
this means that
- any changes test makes database won't affect other threads while it's in-progress
- the next test's data isn't polluted prior tests
- this zillion times faster manually reloading data each test.
i 1 think pretty cool
Comments
Post a Comment