开发者

Setup a testdirectory for a Rails Plugin

I started to create a rails plugin which includes some class and instance methods of Controller and Model. I fist tried to setup the tests for the Model.

Add a models directory in my test dir. But i noticed - i need the geokit-rails plugin for my model to be able to "acts_as_mappable"

How to get the plugin into the tes开发者_如何学编程t dir? I tryied to copy it to /test/plugins/geokit-rails and include it in my test_helper?

require 'geokit'
require PLUGIN_ROOT + '/test/plugins/geokit-rails/lib/geokit-rails.rb'

I get an error from the plugin

MissingSourceFile: no such file to load — geokit-rails/defaults

any suggestions?


i got the plugin running with some changes in geokit-rails/lib/geokit-rails.rb

dir = File.join(File.dirname(__FILE__))
require dir + '/geokit-rails/defaults'
require dir + '/geokit-rails/adapters/abstract'
require dir + '/geokit-rails/acts_as_mappable'
require dir + '/geokit-rails/ip_geocode_lookup'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜