File: request_headers_tests.rb

package info (click to toggle)
ruby-excon 0.112.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,232 kB
  • sloc: ruby: 7,855; makefile: 5
file content (29 lines) | stat: -rw-r--r-- 613 bytes parent folder | download | duplicates (3)
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