Skip to content

Commit

Permalink
add a spec for SYN_REPLY
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasschneider committed Jan 4, 2012
1 parent 8ca91f4 commit 508cecf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions spec/parser_spec.rb
Expand Up @@ -82,6 +82,28 @@
headers['version'].should == "HTTP/1.1"
end

it "should not fire the on_open callback for SYN_REPLY" do
failed = false
s.on_open { failed = true }
s << SYN_REPLY

failed.should be_false
end

it "should return parsed headers for SYN_REPLY" do
sid, headers = nil
s.on_headers do |stream, head|
sid = stream; headers = head
end

s << SYN_REPLY

sid.should == 1

headers.class.should == Hash
headers['version'].should == "HTTP/1.1"
end

it "should parse PING packet" do
fired = false
s.on_ping { |num| fired = num }
Expand Down

0 comments on commit 508cecf

Please sign in to comment.