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' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -