Parent

Class/Module Index [+]

Quicksearch

Rex::Proto::Http::Packet::Header::UnitTest

Constants

Klass

Public Instance Methods

test_from_s() click to toggle source
# File lib/rex/proto/http/header.rb.ut.rb, line 22
def test_from_s
        h = Klass.new

        h.from_s(
                "POST /foo HTTP/1.0\r\n" +
                "Lucifer: Beast\r\n" +
                "HoHo: Satan\r\n" +
                "Eat: Babies\r\n" +
                "\r\n")

        assert_equal('Babies', h['Eat'], 'header')
        assert_equal('Satan', h['HoHo'], 'header')
        assert_equal('Satan', h['hOhO'], 'header')

        assert_equal("POST /foo HTTP/1.0\r\n", h.cmd_string, 'cmd_string')
end
test_just_cmdstring() click to toggle source
# File lib/rex/proto/http/header.rb.ut.rb, line 39
def test_just_cmdstring
        h = Klass.new

        h.from_s("POST /foo HTTP/1.0")
        assert_equal("POST /foo HTTP/1.0\r\n", h.cmd_string, 'just cmd_string')
end
test_to_s() click to toggle source
# File lib/rex/proto/http/header.rb.ut.rb, line 11
def test_to_s
        h = Klass.new

        h['Foo']     = 'Fishing'
        h['Chicken'] = 47

        assert_equal(
                "Foo: Fishing\r\n" +
                "Chicken: 47\r\n\r\n", h.to_s)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.