This project is archived and is in readonly mode.
[PATCH] :memoized methods are stored in Klass.memoized_methods
-
Michael Koziarski
- Assigned user set to josh
I still feel that this is better handled by you writing your own assertion
def assert_memoized(object, method) assert object.respond_to? "_unmemoized_#{method}" endChanging the implementation just to suit tests seems broken.
-
josh
- State changed from new to wontfix
You might want to add some test coverage for mixins, inheritance, and extending objects. You might find an instance variable just won't work how you except it. Seriously, I tried this approach when I first wrote this helper.
-
MatthewRudy
hmm, yeah. maybe Mr Koz.
I still don't understand why this doesn't use alias_method_chain, though.
I may just abandon using :memoize anyway, as it doesn't seem like the best idea in the world.
I still see a use in asserting that a rails method has been used.
eg.
Model.should have_many(:sausages).with(:conditions => {:tasty => true})
is useful.
Although, I guess my particular brand of testing logic is distinct from yours.
Take it easy. Will nudge you at RailsConf in a week-ish