beatrichartz/shoulda-callback-matchers — pull request #3 by pvertenten (2014-02-13 18:36:35+00:00)
Title: Updating matcher to support testing class callbacks

Added support for object based callbacks in addition to the already supported :symbol callbacks.

So now both of the following will work.

after_create :track_activity
it { should callback(:track_activity).after(:create) }

and

after_create ActivityTracker.new
it { should callback(ActivityTracker).after(:create) }

I am possibly using some undocumented apis, but used respond_to? to guard against api changes.

Anyway, I am sending you this pull request to get the conversation started about incorporating this if that is what you end up wanting.

Still would need to add tests and update the documentation, and it could be made to further test items on the callback class as well.