amatsuda / database_rewinder

minimalist's tiny and ultra-fast database cleaner
MIT License
807 stars 91 forks source link

Object's created in before(:all) are removed #32

Open skatkov opened 9 years ago

skatkov commented 9 years ago

It seems like a common pattern for DatabaseCleaner to fasten up your tests. Some objects that stay immutable during testing, get pulled into before(all) and reused in tests, so they don't get recreated all the time.

This pattern doesn't seem to be working with DatabaseRewinder gem, i've noticed that object in before(:all) get cleaned after first test run.

Any alternatives to this?

DmitryKK commented 9 years ago

The same Q. I have the same error. Gem works fine, the tests pass quickly. But where there is a before(:all) tests fails

skatkov commented 9 years ago

@DmitryKK there is a good workaround in one of opened issues https://github.com/amatsuda/database_rewinder/issues/28