PragTob/after_do

Make it work with Modules?

Closed this issue · 1 comments

It might be nice to do something like this: Enumerable.after :each do .. end e.g. for every method from a module that gets called.

Dunno if that is possible/desirable... have to ponder on that.

Preliminary close.

There was an error in my specs (e.g. the base class also already extended AfterDo which made it work).

The current implementation should also work with modules if the behavior in Ruby was different. There are tricks how to make it either way (e.g. we could define the methods straight in the class/module that extends us - that's not really a nice thing to do though.). So I'll wait for the outcome of that issue and then see. Right now I don't see glaring use cases for working with modules... but it'd be nice.

I pushed some work to the module_inclusion branch.