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

21 commits

Author SHA1 Message Date
Andy Brody
4971d1a6e1 Convert specs to RSpec 2.99.2 syntax with Transpec
This conversion is done by Transpec 3.2.2 with the following command:
    transpec

* 317 conversions
    from: obj.should
      to: expect(obj).to

* 160 conversions
    from: obj.stub(:message)
      to: allow(obj).to receive(:message)

* 100 conversions
    from: obj.should_receive(:message)
      to: expect(obj).to receive(:message)

* 30 conversions
    from: lambda { }.should
      to: expect { }.to

* 22 conversions
    from: obj.should_not_receive(:message)
      to: expect(obj).not_to receive(:message)

* 4 conversions
    from: obj.should_not
      to: expect(obj).not_to

* 2 conversions
    from: == expected
      to: eq(expected)

* 1 conversion
    from: expect(collection).to have_at_least(n).items
      to: expect(collection.size).to be >= n

* 1 conversion
    from: obj.unstub(:message)
      to: allow(obj).to receive(:message).and_call_original

For more details: https://github.com/yujinakayama/transpec#supported-conversions
2016-06-05 19:52:16 -04:00
Andy Brody
4932e7e358 Deprecate :timeout in favor of :read_timeout.
This better matches the behavior of Net::HTTP and will make it more
obvious to users what the option actually does.
2015-03-14 15:18:36 -07:00
Andy Brody
8b8731388f Add test of EUC-JP encoding. 2015-03-13 18:48:17 -07:00
Andy Brody
b732acec1e Rework timeouts to differentiate HTTP 408.
Previously, rest-client would raise RestClient::RequestTimeout both when
successfully receiving an HTTP 408 response from the server and when
hitting connection timeouts upon receiving no response from the server.

It is important to be able to distinguish these cases, so we break
compatibility to start introducing a new exception hierarchy. RestClient
will continue to raise RestClient::RequestTimeout for HTTP 408
responses.

There is a new RestClient::Exceptions::Timeout class, which inherits
from RestClient::Exception, and this is the base for two new exceptions:
RestClient::Exceptions::OpenTimeout and
RestClient::Exceptions::ReadTimeout.

These new exceptions mirror the Net::OpenTimeout and Net::ReadTimeout
classes introduced in Ruby 2.0, and they work even in Ruby 1.9.3. All of
these exceptions also store the original wrapped exception, which is now
accessible at `#original_exception`.

Fixes: #337
2014-12-05 14:54:42 -08:00
Andy Brody
39ef456279 Rename Platform.mac? to .mac_mri? for clarity.
This better reflects the fact that the method is expected to return
false on non-MRI engines even on OS X.
2014-11-02 18:32:04 -08:00
Andy Brody
bd01dd5902 Fix typo. 2014-04-25 17:32:10 -07:00
Andy Brody
cc7887f0a0 Fix tests, verify_callback functionality on jruby. 2014-04-09 22:12:41 -07:00
Andy Brody
72a5b19a9b Add some tests around ssl_verify_callback. 2014-04-09 20:59:56 -07:00
Andy Brody
902db106a6 Disable failing OS X tests.
Apple patches OpenSSL to always fall back on the system CA store, so
the integration tests that expect SSL cert failures have never worked on
OS X. Disable them since I can't think of a workaround :-(.

TODO: add some integration tests on certificates that won't be in any
system CA store.
2014-04-03 14:05:18 -07:00
Andy Brody
b59e2e5b3c Don't use verify_callback.
The OpenSSL verify_callback isn't supported on jruby [1], and behaves in
somewhat surprising ways on OS X due to Apple monkey patching OpenSSL.

We probably want to move in the direction of just passing through the
OpenSSL exceptions anyway.

[1] https://github.com/jruby/jruby/issues/597

Fixes: #165
See also: #168, e03e5e6c
2014-04-02 01:39:23 -07:00
Andy Brody
e06d044d42 Add integration test for the default cert store. 2014-03-31 20:50:27 -07:00
Andy Brody
f270844339 Enable SSL peer verification by default.
Fixes #139, #255

SSL verification will not be performed if `:verify_ssl` is falsy or a
constant like `OpenSSL::SSL::VERIFY_NONE` that disables verification.
2014-03-13 00:09:54 -07:00
Philip Corliss
d242580dd5 Fixing broken ssl integration specs.
The integration specs use mozzilla.com which now redirects to
mozilla.org and uses a different ssl cert with a different issuer than
before.
2014-02-12 09:10:58 -06:00
Larry Gilbert
d7a11503af Reorganize specs
* Put unit and integration specs into separate subdirectories
* Consolidate all requires of 'webmock/rspec' into spec_helper.rb
* Use WebMock.{disable!,enable!} for specs calling live server
2013-08-30 18:45:06 -07:00
Larry Gilbert
9b083b6a6e Changed use of spec/base.rb into spec/spec_helper.rb 2013-08-30 18:45:06 -07:00
Andy Brody
fe5b5bb201 Add tests for SSL CA path behavior. 2013-07-30 18:22:51 -07:00
Dmitri Dolguikh
e03e5e6ce9 fixed failing integration/request_spec.rb. All tests are passing now 2012-11-16 12:36:25 +00:00
Dmitri Dolguikh
178a0d82c8 an assortment of fixes to make tests passing with recent versions of dependecnies 2012-11-16 12:00:20 +00:00
Julien Kirch
f3026e48ae Fix cert test by using mozilla instead of google. Closes #82 2011-08-15 11:01:43 +02:00
Niko Dittmann
a6e3f85684 ! one more 1.9.2 loading fix 2010-07-04 15:49:09 +02:00
Braintree
9c81ee50a5 Fixed ssl verification to raise an exception when the ca certificate is incorrect. 2010-05-13 19:59:01 +02:00