readonly
readonly

Reputation: 355664

Where do rspec tests for code under lib/ go?

I've got some code in the lib/ directory that don't really belong under controls, models or helpers. I'd like to write some rspec tests for this code, but am not sure where they should go under the spec/ directory. Is there a convention that's commonly followed?

Upvotes: 33

Views: 5163

Answers (1)

wvb
wvb

Reputation: 216

I would use a subdirectory of /spec as well. However, I would consider refactoring the code into a separate plugin or gem if it is really separate and can be tested standalone. In this plugin, you can create a separate spec-directory.

Upvotes: 17

Related Questions