Sha256: 34e2bf1d92fcdffd0233891ea13228adfc251874123af40e6a6f59a7f85e79f3
Contents?: true
Size: 1.02 KB
Versions: 28
Compression:
Stored size: 1.02 KB
Contents
Shindo.tests('Excon Response Validation') do env_init with_server('good') do tests('good responses with complete headers') do 100.times do res = Excon.get('http://127.0.0.1:9292/chunked/simple') returns(true) { res.body == "hello world" } returns(true) { res.status_line == "HTTP/1.1 200 OK\r\n" } returns(true) { res.status == 200} returns(true) { res.reason_phrase == "OK" } returns(true) { res.remote_ip == "127.0.0.1" } end end end with_server('error') do tests('error responses with complete headers') do 100.times do res = Excon.get('http://127.0.0.1:9292/error/not_found') returns(true) { res.body == "server says not found" } returns(true) { res.status_line == "HTTP/1.1 404 Not Found\r\n" } returns(true) { res.status == 404} returns(true) { res.reason_phrase == "Not Found" } returns(true) { res.remote_ip == "127.0.0.1" } end end end env_restore end
Version data entries
28 entries across 26 versions & 4 rubygems