technicalpickles/capistrano-spec — pull request #12 by jbscv (2013-04-30 20:15:50+00:00)
Title: Allowing to test multiple callbacks on the same task

In my project I had several 'after' callbacks with the same task. This is part of my recipe:

after 'development', 'load_dinamic_variables'
after 'qa', 'load_dinamic_variables'
after 'prod', 'load_dinamic_variables'

when I tried to test this callbacks I found out that all test that asserted the 'after' callbacks but the first one, failed. I realized that this was a bug in capistrano-spec actually since when you seek the callbacks you use the first one in the array and discard the rest.

I modified this in order to check if the callback is present in the whole array instead of just checking the first one.

Added some tests as well.