File: a_readable_body.rb

package info (click to toggle)
ruby-protocol-http 0.55.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 840 kB
  • sloc: ruby: 6,904; makefile: 4
file content (28 lines) | stat: -rw-r--r-- 499 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2024, by Samuel Williams.

module Protocol
	module HTTP
		module Body
			AReadableBody = Sus::Shared("a readable body") do
				with "#read" do
					it "after closing, returns nil" do
						body.close
						
						expect(body.read).to be_nil
					end
				end
				
				with "empty?" do
					it "returns true after closing" do
						body.close
						
						expect(body).to be(:empty?)
					end
				end
			end
		end
	end
end