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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -