Fix deprecated messages from rspec mock and any_number_of_time.

Both the `mock` and the `any_number_of_time` functions within the specs were replace by a non-deprecated alternative.