Forum: Ruby on Rails Plugins unit testing

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
75da740d43c5780539214f24ce1148a6?d=identicon&s=25 Jean Helou (Guest)
on 2006-01-04 22:40
(Received via mailing list)

I am refactoring a utility class from my application in a plugin and I
am trying to get the unit tests to pass. (they were going pretty fine
before I moved things into a plugin)

I did find the 'rake test_plugins' command, which seems to trigger my
unit tests, however the load path does not seem to include my plugin's
directories, so all my previously valid require directive are now
saying they can't find the files.

I read the Plugins Conventions thread initiated in october by Jamis
Buck, it does mention the need for unit testing but no agreement was
reached over conventions / helpers to use for plugin unit testing.

currently i have the following structure :

  |- app/
  |   |- controllers/
  |   |- models/
  |   |- helpers/
  |   |- views/
  |- lib/
  | - <etc>
  |- vendor/
      |- plugins/

Is this correct ? should my tests work as they did when they lived in
the main test dir , is it expected that I have to redefine all the
require paths ?

This topic is locked and can not be replied to.