Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

issues with checking headers #193

Closed
sunilkr opened this Issue · 1 comment

1 participant

@sunilkr

http= Net::HTTP.start('www.example.com','80')

stub_request(:get, "http://www.example.com/get2").
with(:header=>{'X-Header'=>'Invalid'}).
to_return(:body=>'SUCCESS')

req = Net::HTTP::Get.new("/get2")
req['X-Header'] = 'TestHeader'
resp = http.request(req)
raise 'Invalid body content' unless resp.read_body == 'SUCCESS'

did not raise any exceptions while the actual headers were

accept:/
user-agent:Ruby
x-header:TestHeader

@sunilkr

i missed an 's' here. my bad.

@sunilkr sunilkr closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.