Why is RSpec so slow under Rails?

前端 未结 11 559
无人共我
无人共我 2020-12-24 05:00

Whenever I run rspec tests for my Rails application it takes forever and a day of overhead before it actually starts running tests. Why is rspec so slow? Is there a way to

11条回答
  •  粉色の甜心
    2020-12-24 05:39

    If you're using a Mac I recommend using Rspactor over autotest as it uses a lot fewer resources for polling changed files than autotest. There is both a full Cocoa version

    RSpactor.app

    or the gem version that I maintain at Github

    sudo gem install pelle-rspactor
    

    While these don't speed up individual rspec tests, they feel much faster as they auto run the affected spec's within a second of you hitting save.

提交回复
热议问题