Rails: Specing libraries

I was reading the documentation on using rails with rspec and I didn’t
anything about how to spec libraries in the rails /lib directory so that
they’re integrated into the whole spec::rails system.
Where should I put specs for my libraries, and what’s the best way to
require the files that I’m testing in my spec?

I’ve never used rspec before, and I’m new to rails, so I’m huge newb.


In most cases you could just create a lib folder under spec with your
new file in it. For example if you have:


You would have:


That starts out something like:

require File.expand_path(File.dirname(FILE) + ‘/…/…/spec_helper’)

describe MyExtension do


And that should about do it.

Chad H.