1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00
Commit graph

11 commits

Author SHA1 Message Date
Jon Rowe
f0bf4d8838 cleanup trailing whitespace
(cherry picked from commit d6bb24c75b)
Signed-off-by: Larry Gilbert <larry@l2g.to>
2014-02-03 13:21:01 -08:00
Jon Rowe
c6a791f752 convert == to eq to avoid warnings, (all were done for concistency)
(cherry picked from commit 0b6e74593a)
Signed-off-by: Larry Gilbert <larry@l2g.to>

Conflicts:
	spec/request_spec.rb
2014-02-03 13:18:31 -08:00
Kosuke Asami
4086123c31 Use 'double' instead of 'mock' about rspec-mock
'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
2014-01-24 19:28:55 -08:00
Matt Manning
dac3f48e26 include WebMock::API to get rid of deprecation warnings 2013-10-30 12:41:11 -07:00
Michael Klett
2caea9b9f0 RestClient::Exception#message should always return a String, never a NilClass.
RestClient::Exception subclasses RuntimeError, which is a subclass of Exception.  According to the Ruby documentation (http://www.ruby-doc.org/ruby-1.9/classes/Exception.html#M000100), the +message+ method is expected to return a string.  Before this commit, RestClient::Exception#message would return nil if a message was not set.

This presents a problem for any code that rescues a RestClient::Exception and expects a string in the +message+.

For example:

    begin
      raise RestClient::Exception
    rescue Exception => e
      puts e.message + "\n" + "More information"
    end

Or, for example, the real life code that uncovered this in production: a0d6cdb263/lib/delayed/job.rb (L72)

This fix makes RestClient::Exceptions better citizens of the Ruby ecosystem. :)
2010-11-23 20:08:29 +01:00
Niko Dittmann
ec7e9923cc ! ruby 1.9.2 spec loading 2010-07-04 15:47:06 +02:00
Julien Kirch
ccb591958c Added compatibility: the response should mimic a net::response when in an exception 2010-02-06 22:32:52 +01:00
Julien Kirch
26aa3ce8d0 Fixed tests 2010-01-20 19:57:38 +01:00
Julien Kirch
026f2ea360 Tabs to space 2009-12-29 18:27:39 +01:00
Pedro Belo
cb0dd1fd3b decode response body for exceptions too (401, 404, etc) 2009-06-29 16:22:54 -07:00
Adam Wiggins
be75302792 organize specs to match lib 2009-01-24 14:55:18 -08:00
Renamed from spec/request_errors_spec.rb (Browse further)