ruby on rails - How could I test customized object under lib folder -


let's have custom object put @ /lib folder

i want test it's functionality under rspec, how ?

how create test function ? should go ? thanks

first of all,
lib path added in autoload path. if not, add config.autoload_paths << rails.root.join('lib')

you have spec directory /spec. create lib directory /spec/lib , create {lib_test_name}_spec.rb

and write code same other spec.


Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -