def test_ns
@ns_map.start_element
@ns_map.add_ns('', 'http://www.w3.org/1999/xhtml')
@ns_map.add_ns('x', 'test://foo')
@ns_map.add_ns('y', 'test://bar')
assert_equal('http://www.w3.org/1999/xhtml', @ns_map[''])
assert_equal('test://foo', @ns_map['x'])
assert_equal('test://bar', @ns_map['y'])
assert_nil(@ns_map['z'])
@ns_map.start_element
@ns_map.add_ns('', 'test://foo')
@ns_map.add_ns('x', 'http://www.w3.org/1999/xhtml')
@ns_map.add_ns('y', 'test://foo')
@ns_map.add_ns('z', 'test://bar')
assert_equal('test://foo', @ns_map[''])
assert_equal('http://www.w3.org/1999/xhtml', @ns_map['x'])
assert_equal('test://foo', @ns_map['y'])
assert_equal('test://bar', @ns_map['z'])
@ns_map.end_element
assert_equal('http://www.w3.org/1999/xhtml', @ns_map[''])
assert_equal('test://foo', @ns_map['x'])
assert_equal('test://bar', @ns_map['y'])
assert_nil(@ns_map['z'])
@ns_map.end_element
end