Skip to content

Commit 022b2d0

Browse files
Improve test consistency.
1 parent 20f2aca commit 022b2d0

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

test/protocol/http/header/accept.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,14 @@
9898
end
9999
end
100100

101-
with "backward compatibility" do
102-
it "can initialize with string" do
101+
with ".new" do
102+
it "preserves values when given array" do
103+
header = subject.new(["text/html", "application/json"])
104+
expect(header).to be(:include?, "text/html")
105+
expect(header).to be(:include?, "application/json")
106+
end
107+
108+
it "can initialize with string (backward compatibility)" do
103109
header = subject.new("text/plain, text/html")
104110
expect(header).to be(:include?, "text/plain")
105111
expect(header).to be(:include?, "text/html")

test/protocol/http/header/trailer.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,14 @@
7474
end
7575
end
7676

77-
with "backward compatibility" do
78-
it "can initialize with string for backward compatibility" do
77+
with ".new" do
78+
it "preserves values when given array" do
79+
header = subject.new(["etag", "content-md5"])
80+
expect(header).to be(:include?, "etag")
81+
expect(header).to be(:include?, "content-md5")
82+
end
83+
84+
it "can initialize with string (backward compatibility)" do
7985
header = subject.new("etag, content-md5")
8086
expect(header).to be(:include?, "etag")
8187
expect(header).to be(:include?, "content-md5")

0 commit comments

Comments
 (0)