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
- Re-parent RestClient::Exceptions::Timeout under
RestClient::RequestTimeout. Ideally these would be separate, since
HTTP 408 is completely unrelated to network timeouts. However, making
Timeout a subclass of RequestTimeout will preserve backwards
compatibility while still making it possible to distinguish between
the cases for users who want to.
- Make all HTTP status exception classes subclasses of
RestClient::RequestFailed. Previously there were exceptions carved out
for HTTP 304, 401, and 404, which for some reason directly subclassed
the parent class of RequestFailed, ExceptionWithResponse. I don't know
what purpose this served.
The actual HTTP response code is "Not Found", and basically every other
exception matches the RFCs. Preserve ResourceNotFound as an alias for
backwards-compatibility.
Fixes: #265
* 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