http 0.8.14 → 0.9.0.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,35 +0,0 @@
1
- RSpec.describe HTTP::Response::IoBody do
2
- subject(:body) { described_class.new StringIO.new("Hello, World!") }
3
-
4
- it "has the content" do
5
- expect(subject.to_s).to eq "Hello, World!"
6
- end
7
-
8
- context "when body empty" do
9
- subject(:body) { described_class.new StringIO.new("") }
10
-
11
- it "returns responds to empty? with true" do
12
- expect(subject).to be_empty
13
- end
14
- end
15
-
16
- describe "#readpartial" do
17
- context "with size given" do
18
- it "returns only that amount" do
19
- expect(body.readpartial(4)).to eq "Hell"
20
- end
21
- end
22
-
23
- context "without size given" do
24
- it "returns parts of the content" do
25
- expect(body.readpartial).to eq "Hello, World!"
26
- end
27
- end
28
- end
29
-
30
- describe "#each" do
31
- it "yields successive parts of the content" do
32
- expect { |b| body.each(&b) }.to yield_with_args "Hello, World!"
33
- end
34
- end
35
- end
@@ -1,35 +0,0 @@
1
- RSpec.describe HTTP::Response::StringBody do
2
- subject(:body) { described_class.new "Hello, World!" }
3
-
4
- it "has the content" do
5
- expect(subject.to_s).to eq "Hello, World!"
6
- end
7
-
8
- context "when body empty" do
9
- subject(:body) { described_class.new "" }
10
-
11
- it "returns responds to empty? with true" do
12
- expect(subject).to be_empty
13
- end
14
- end
15
-
16
- describe "#readpartial" do
17
- context "with size given" do
18
- it "returns only that amount" do
19
- expect(body.readpartial(4)).to eq "Hell"
20
- end
21
- end
22
-
23
- context "without size given" do
24
- it "returns parts of the full content" do
25
- expect(body.readpartial).to eq "Hello, World!"
26
- end
27
- end
28
- end
29
-
30
- describe "#each" do
31
- it "yields contents" do
32
- expect { |b| body.each(&b) }.to yield_with_args "Hello, World!"
33
- end
34
- end
35
- end