user1172240
user1172240

Reputation: 93

How can I specify multiple directories for RSpec to pull tests from?

I have some vendored gems that are being developed in tandem with my project and i'd like to be tell rspec to run the tests for those gems as well as those for my main app. Is there a simple way to do this?

Upvotes: 9

Views: 1965

Answers (2)

maikel
maikel

Reputation: 1789

If you are using rspec and all your spec files are ending in _spec.rb then you can simply define the Rails root directory:

rspec .

Depending on the size of your codebase, this may be slower but in my case it didn't make a difference and found all specs no matter in which directory they are, for example in engines/*/spec.

Upvotes: 0

Ultimation
Ultimation

Reputation: 1069

just put spaces in between the directories like:

rspec spec/model/location.rb ../gem/spec/requests/user.rb

Upvotes: 16

Related Questions