gocardless/statesman — pull request #83 by isaacseymour (2014-09-13 17:06:50+00:00)
Title: Allow adding callbacks against multiple to states, and bump rubocop

Allows options[:to] to be an array in add_callback, as per #80
* if to is nil or [] it adds one callback with to: nil as before
* if to is a string/symbol it adds one callback to that state
* if to is an array it adds callbacks to each of those states.

Also DRYed the specs a bit, with shared examples for add_callback succeeding/failing, and bumped Rubocop to 0.26 as everyone loves new cops.

Kinda hate how `nil` is used to mean "any state", especially as this means `<<`ing in nil if an empty array is used for `to`.

@mrappleton could you review this, as it changes functionality? There's some discussion in #82 which was not against master (apologies).