Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Added tests for Reel::Request #227

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
11 changes: 11 additions & 0 deletions spec/reel/connection_spec.rb
Expand Up @@ -338,6 +338,17 @@ def test_chunked_response(request, client)
end
end

it "detaches a connection properly" do
with_socket_pair do |client, peer|
connection = Reel::Connection.new(peer)
client << ExampleRequest.new.to_s
c = connection.detach

expect(c).to be_a Reel::Connection
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@digitalextremist Do you we can combine line 345 with this line?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes @aayushranaut, you can move connection.detach into the expect() call.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@digitalextremist Moved connection.detach into expect() call.

expect(connection.attached?).to eq(false)
end
end

it "returns friendlier inspect output" do
with_socket_pair do |client, peer|
connection = Reel::Connection.new(peer)
Expand Down