how to test gem
程序员文章站
2024-03-11 16:40:55
...
I wrote some gems in my project, but testing them is a big pain.
Everytime I want to make sure all functions work, I need to make a test model outside gem and test there.
Here is one solution:
make a spec folder in gem.
Take test string_extension.rb as example.
In spec/string_extension_spec.rb add environment:
require "../lib/extensions/string_extension.rb"
require 'rubygems'
require 'active_support'
require 'active_support/inflector'
Ok, then write you test code as will.
推荐阅读
-
升级 Gem 的方法
-
how to test gem
-
gem install 无效解决办法
-
jruby 下升级 gem 版本的问题
-
Java SE: How to iterate Stack 博客分类: JavaSE JavaStackIterate
-
How to configure pam_tally2 to lock user account after certain number of failed login attempts
-
AB test
-
How to recognise a good programmer SocialrspecFlexPascalUP
-
How to Learn Any Language 44 SocialGoUP
-
How to Learn Any Language 31 SocialOperaExchangeFlash