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

9 commits

Author SHA1 Message Date
Andy Brody
197bb96c94 Use built-in Net::HTTP support for compression.
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`.
2017-05-03 23:18:57 -04:00
Andy Brody
0d8f777fec Fix default Net::HTTP encoding in Windows tests.
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).
2016-06-19 14:11:42 -07:00
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
1bb58653a8 Fix handling of invalid encoding with nil log.
Fixes: #469
2016-05-12 17:39:07 -07:00
Andy Brody
e52e24a095 Add a couple more default encoding tests. 2015-03-14 12:19:59 -07:00
Andy Brody
8b8731388f Add test of EUC-JP encoding. 2015-03-13 18:48:17 -07:00
Andy Brody
5ce0c6ebde Fix up tests for encoding changes.
Add a `.to_hash => {}` for the Net HTTP response mocks.
2015-03-13 18:00:51 -07:00
Andy Brody
b860da40d5 Start adding Content-Type charset handling. 2015-01-28 19:48:02 -08: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
Renamed from spec/integration_spec.rb (Browse further)