sandro / specjour

distributed rspec & cucumber via bonjour
MIT License
212 stars 33 forks source link

Add before test hook #25

Closed cbarton closed 13 years ago

cbarton commented 13 years ago

For specific cases, there might be some caching issues when a test is run, for example in our application we use fixture data and transactional fixtures. After a test runs there is a chance that the global fixtures recognize the fixtures as in the database when they are not due to the natural parallelism experienced. With this in mind, before each test we must clear out the fixture cache that active record creates.

Enter the before_test hook where we can specify to clean out the cache and it works!

l4rk commented 13 years ago

Thanks for the pull request. @leshill and I will take a look this Friday afternoon.

sandro commented 13 years ago

Can't you use rspec's before and after hooks?

sandro commented 13 years ago

How does Lane's formatter relate to your original "before_test" pull request? What benefits does this new formatter present?

cbarton commented 13 years ago

This is true.. good point sir. And sorry about the bad merge, meant for it to be another branch.

sandro commented 13 years ago

The major difference is that your before_test hook gets run before each file, rather than before each spec. However, I think it's a good idea for your test suite to be able to run independently of specjour, which is why I recommend using rspec's hooks.