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

sql - VB.NET Operand type clash: date is incompatible with int error -

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

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -