The Net::HTTP in ruby 2.0+ supports gzip and deflate decoding on its
own. Remove Accept-Encoding from the default headers set, and instead
let Net::HTTP take care of it.
Note: this could break compatibility for users who are setting
Accept-Encoding headers themselves or who expect the body to still be
compressed with `:raw_response => true`.
It turns out that Net::HTTP seems to always use UTF-8 as the default
encoding, even when Encoding.default_external is Encoding::IBM437 (as it
is on Windows/mingw).
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
* 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