I’m having trouble writing tests for a plugin I’m working on.
In my plugin directory, I have /lib/my_plugin.rb :
require ‘extensions’ # in [plugin]/lib
class NewClass < ActiveForm # ActiveForm defined in a different plugin
My [plugin]/test/my_test.rb has the following
require File.dirname(FILE) + ‘/…/lib/my_plugin’
However, I get
“in `gem_original_require’: no such file to load – extensions
and, if I remove the call to require ‘extensions’
uninitialized constant ActiveForm (NameError)
How can I write my tests/structure my plugin to avoid these errors?
As an aside, is there any documentation on what the load path is at any
time? I mean something saying “[these] directories are available when
rather than me having to try 'puts’ing a variable at different points in
application to learn through trial and error