`
fsword
  • 浏览: 164958 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

终于决定还是放弃rspec的transaction了

阅读更多

反复遇到不能正确cleanup的问题,今天看到这篇blog,虽然有点旧,但是确实就是我的现状,不明白rspec为什么改不好,还是决定用database_cleaner了。

博客主要内容摘抄

 

This will fail. It will fail because that let statement lives outside of the transactions, so it doesn't get cleaned up, and that old stale database object sits around polluting the database.

That means let() blocks, subject() blocks, it() blocks, its() blocks and specify() blocks are all exempt from cleanup.

 

使用以后的感受,果然象传说的一样,用例执行速度确实慢了很多,不过还能忍受

0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics