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
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
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.
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/597Fixes: #165
See also: #168, e03e5e6c
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.
* 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