'mock' is deprecated after rspec-mock 2.14.0.rc1(2013-05-27 released).
'mock' method may be removed for rspec-mock 3.0.0.
And, this fixes can remove following warnings.
DEPRECATION: mock is deprecated. Use double instead. Called from ...
(cherry picked from commit c0fd016dc3)
Conflicts:
spec/request_spec.rb
In some versions of Ruby, a parenthesis ambiguity warning would be emitted:
[...] ruby/1.8/gems/rest-client-1.6.1/lib/restclient/abstract_response.rb:50: warning: parenthesize argument(s) for future version
Better to be unambiguous about the exception and include the response code too.