File: parser.rb

package info (click to toggle)
ruby-protocol-http1 0.35.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 376 kB
  • sloc: ruby: 2,367; makefile: 4
file content (40 lines) | stat: -rw-r--r-- 1,046 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
29
30
31
32
33
34
35
36
37
38
39
40
# frozen_string_literal: true

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

require "protocol/http1/connection"

describe Protocol::HTTP1 do
	describe "REQUEST_LINE" do
		it "parses in linear time"  do
			skip_unless_method_defined(:linear_time?, Regexp.singleton_class)
			
			expect(Regexp).to be(:linear_time?, Protocol::HTTP1::REQUEST_LINE)
		end
	end
	
	describe "HEADER" do
		it "parses in linear time"  do
			skip_unless_method_defined(:linear_time?, Regexp.singleton_class)
			
			expect(Regexp).to be(:linear_time?, Protocol::HTTP1::HEADER)
		end
	end
	
	describe "VALID_FIELD_NAME" do
		it "parses in linear time"  do
			skip_unless_method_defined(:linear_time?, Regexp.singleton_class)
			
			expect(Regexp).to be(:linear_time?, Protocol::HTTP1::VALID_FIELD_NAME)
		end
	end
	
	describe "VALID_FIELD_VALUE" do
		it "parses in linear time"  do
			skip_unless_method_defined(:linear_time?, Regexp.singleton_class)
			
			expect(Regexp).to be(:linear_time?, Protocol::HTTP1::VALID_FIELD_VALUE)
		end
	end
end