[Rspec-devel] Using rspec with rails plugins, engines, etc.

Jay Levitt lists-rspec at shopwatch.org
Tue Aug 29 11:13:57 EDT 2006

Daniel Siemssen wrote:
> What exactly does not get reloaded / What do you want to get reloaded?

I'm writing an authentication engine with the fairly typical structure:


myplugin.rb reads, as you'd expect:

   require "myplugin/myplugin1"
   require "myplugin/myplugin2"

Those, in turn, populate the module Myplugin.  application.rb (and 
myplugin.rb) include Myplugin.

I'd like to be able to make changes to myplugin1.rb without having to 
restart rails_spec_runner.

It actually gets slightly trickier; myplugin1.rb borrows an idea from 
LoginEngine, and defines the user model instance methods as a module 
that gets dragged in by self.included.  That, in turn, uses .class_eval 
to load the attributes, and .extend to load the class methods.

If you're interested in tackling it, and if the trickiness is actually 
tricky, I can tar up what I've got so far and send it off-list.

> Daniel
> _______________________________________________
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel

More information about the Rspec-devel mailing list