- If Payload.generate() receives a Payload::Base or subclass, then
return it as is rather than pointlessly wrapping it in a
Payload::Streamed.
- Add a `.closed?` method to Payload::Base that wraps the underlying
stream's `.closed?` method.
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
Remove Request#process_payload, which hasn't actually been used in ages.
Also rewrite the tests that called it to actually test code that is in
use, even though they are bad unit tests.
Remove HashMapForTesting, which was never used.
The previous boundary used a random number up to 1,000,000 as the
boundary. This is extremely low entropy compared to what most major
browsers use (20 bits). Instead, use a convention more like WebKit.
RestClient previously would be completely unable to upload a file
generated like so, containing `--0--` through `--1000000--`:
File.open('foo.txt', 'w') {|f|
1_000_000.times {|i| f.write("--#{i}--\n") }}
Instead, the boundary now looks like this, with about 95 bits of entropy:
`----RubyFormBoundaryFg2MqiXXQlT5RkUF`
* 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