Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Daniel Lopera
Daniel Lopera
2,067 Points

Why is RSpec so slow?

I'm just going to ask here because it has been a pain testing in Ruby. I don't know why is it that when I try to test something it takes about 0.2 seconds doing the test but about 15 seconds to actually load the files needed to do this!

What can I do to make it easier and faster the testing process? Why is it that Jasons tests run so fast?

Thanks a lot!

2 Answers

Brandon Barrette
Brandon Barrette
20,485 Points

Is it that you are getting a bunch of depreciation warnings? If your version is ahead of Jason's? There has been some changes in Rspec 3 that could cause your tests to run slower.

You can type

gem -v rspec

to see the version installed in your project.

Daniel Lopera
Daniel Lopera
2,067 Points

It says I have the 2.2.2, but in bundler this is what it displays "Using rspec-rails 3.2.0".

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

That's weird, the only RSpec tests that work very slow in my apps are feature tests that test javascript stuff. All the other tests are lightning fast with RSPec 3.