Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to discover why RSpec is taking so long to start?

I know there is a way to know which specs are taking the most time, but my doubt is about the loading of the RSpec. The specs itself are not taking too much time, but the load is.
There is a way to discover that?
I am working on a Rails' legacy code and I don't know which gems could be affecting it.

like image 356
Igorzovisk Avatar asked Nov 06 '22 18:11

Igorzovisk


1 Answers

For anyone who comes here, the problem was that the RSpec was truncating every time I ran the tests.
I discovered it by checking the log while it was starting (tail -f log/test.log).
To solve that, I used the database_cleaner gem and configured it with :transaction as the clean strategy.

config.before(:each) do
    DatabaseCleaner.strategy = :transaction
end
like image 78
Igorzovisk Avatar answered Nov 15 '22 07:11

Igorzovisk