1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
Shindo.tests('Excon request methods') do
with_rackup('request_headers.ru') do
tests 'empty headers sent' do
test('Excon.post') do
headers = {
:one => 1,
:two => nil,
:three => 3,
}
r = Excon.post('http://localhost:9292', :headers => headers).body
!r.match(/two:/).nil?
end
end
tests('header order') do
tests('host is the first sent header by default').returns('host: localhost:9292') do
response = Excon.post('http://localhost:9292/')
response.body.lines.first.chomp
end
end
end
end
|