I have created a model that I use across applications.
module WeblabOnRails
class TimeOnly
#...
end
end
I put the code in my lib/weblab_on_rails/time_only.rb
and I invoke it, each time from application.rb
.
I would like to integrate that code into a gem and write tests using Rspec and Cucumber. I am using Rails 3.2.5.
I recommend you using bundler to create and publish gems. Check out this RailsCast: http://railscasts.com/episodes/245-new-gem-with-bundler . Once you created your gem project you can use RSpec, Cucumber or whatever to test it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.