[rspec-users] How to test scripts in the lib directory of Rails?

Volkan Unsal spocksplanet at gmail.com
Fri Jan 7 18:17:15 EST 2011


I have a script called query.rb inside my lib folder in Rails 3. I am
writing a spec test for it. Though I'm no sure how to reference the
Query class from my tests. Whenever I use Query, RSpec complain that
it's not able to find it.

This is how I wrote it:

    before(:each) do
      query  = Query.new
    end

How can I make sure that Query is accessible by the spec?


More information about the rspec-users mailing list