Replaced deprecated mock and any_number_of_times that were used by RSpec mocks

These two deprecated methods were showing up a lot of warnings when I ran Rake on my machine. I replace both deprecation with what is suggested by rspec-mocks documentation. 

I do not receive the warnings anymore on my machine after this. 

This is my first real pull request (notwithstanding adding a license file that didn't need a branch) and the first time I work with branches so please tell me if I did anything wrong. 

Thank you.