[:index, :list, :show, :create, :update, :export, :search ... (common
action names)].each do |action|
[
ClientsController,
CountriesController,
....
].each do |controller|
if controller.method_defined?(action)
controller.before(:feature => action) do |context, feature,
*args|
Mole::DbMole.mole_it(context, feature,
context.session[:current_user], args)
end
end
end
end
I am looking for comprehensive usage information for a small, internal
application and this seemed simpler than going through each controller
and manually entering action names. Also, I use active scaffold quite
a lot in this app so those are basic active scaffold action names
which would be common to most of my controllers (which makes it easy).
And, yes, Mole is fantastic for testing! A few of my controllers were
rather out of date and didn't have full test coverage (tsk tsk), and
Mole picked up problems as soon as I started up the server.
Anyway, I am posting this to see if anyone else has a better way of
automatically mole-ing an entire app, or if this is a bad idea for a
reason I haven't thought of.
On Sep 26, 3:15 pm, "Fernand Galiana" <fernand.gali...@gmail.com>
wrote:
> Hi Ana,
>
> This is fine. The only reason why we did not provide a framework
> for doing the mass 'moling' was that some action may not be interesting
> to mole for a given controller but also some actions may have a different
> state or params that you may want to 'mole' and that would not fit to
> well
> in the bulk 'moling' example...
>
> -Fernand
>