Writing tests for plugins

I’ve been googling around trying to find some tips on creating tests for
plugins. Am I correct in assuming that I’d have to have the tests as
part of a rails app in order to test the plugin? I’d like to find a way
to do standalone tests for the plugin.

On May 2, 2006, at 11:59 AM, Chris H. wrote:

Rails mailing list
[email protected]


It really depends on what sort of plugin you are creating. But you

can take a look at a few of my plugins to see how I test one of them
without rails and another with fixtures and all.

acl_system does all its tests without the need for rails at all. It
even has a mock controller object so you can test before filters and
such without a full rails env.


ez_where is a think layer of ruby syntax sugar for
ActiveRecord :condition building. It has fixtures and other stuff
that ties into rails testing.


Hopefully you can learn a little bit from the tests in these plugins.


I just checked out the ez_where testing methods and am very
impressed. I like the way sqlite is used in memory and then the
fixtures are loaded as in a normal rails env. It allows for complete
testing but with it all contained in the plugin without stepping on
the app.
Thanks for pointing these out as ways to learn.


One more thing… if anyone can point me to more examples of testing
controllers in plugins that would be great.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs