Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
0exp committed Jul 31, 2024
1 parent 0b358f4 commit 5c623cd
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion spec/ezclient_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,28 @@ def self.sign!(*); end
end

specify "#to_s" do
expect(response.inspect).to eq(response.to_s)
aggregate_failures "<inspect> representation" do
expect(response.inspect).to eq(response.to_s)

# NOTE:
# - for better visual representability;
# - example.com is fetched from `request` object:
# - see request (@http_request.host)
# - see request.verb
# - see request.url
expect(response.inspect).to eq(
"{:req=>{" \
":raw=>\"#<HTTP::Request/1.1 POST http://example.com/>\", "\
":hdrs=>#<HTTP::Headers " \
"{\"User-Agent\"=>\"ezclient/#{EzClient::VERSION}\", " \
"\"Connection\"=>\"close\", " \
"\"Host\"=>\"example.com\"}>}, " \
":resp=>{" \
":raw=>\"#<HTTP::Response/1.1 #{webmock_response[:status]} Created {}>\", " \
":hdrs=>#<HTTP::Headers {}>, " \
":body=>\"\"}}"
)
end
end
end

Expand Down

0 comments on commit 5c623cd

Please sign in to comment.