Im curious about this too. If you do have to require them manually, is
there an easy way to do it? I’ve tried requiring just the init.rb file
and it doesn’t seem to do the trick
On Aug 16, 4:54 am, Raymond O’Connor <rails-mailing-l…@andreas- s.net> wrote:
Im curious about this too. If you do have to require them manually, is
there an easy way to do it? I’ve tried requiring just the init.rb file
and it doesn’t seem to do the trick
Posted viahttp://www.ruby-forum.com/.
Plugins are normally loaded in the test environment, so there’s
something more subtle going on here.
To help understand what’s going on, it might be worth your while
adding a “puts 'loading my hash plugin” at the top of your init.rb,
and noting whether or not (or indeed, when) it gets loaded.
Additionally, how are you running the plugin tests? Via “rake
test:plugins”? However you are doing it, you need to be sure that the
Rails environment is being loaded first. Try adding the following line
to your plugin’s “test/hash_test.rb” file:
I might’ve got the number of “…”‘s wrong there, but basically the
idea is to load Rails’ test/test_helper.rb file. This will then ensure
that the Rails environment is loaded, and your plugin will get loaded
as you’d expect.
HTH,
–
James
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.