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
Post a Comment