12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/vendor/xmpp4r/test/xhtml/tc_html.rb', line 12
def test_set
contents1 = REXML::Element.new('p')
contents1.text = 'Hello'
html = XHTML::HTML.new(contents1)
assert_kind_of(XHTML::Body, html.first_element('body'))
assert_equal("<html xmlns='http://jabber.org/protocol/xhtml-im'><body xmlns='http://www.w3.org/1999/xhtml'><p>Hello</p></body></html>", html.to_s)
contents2 = REXML::Element.new('a')
contents2.attributes['href'] = 'about:blank'
contents2.text = 'nothing'
html.contents = ["Look at ", contents2]
assert_equal("<html xmlns='http://jabber.org/protocol/xhtml-im'><body xmlns='http://www.w3.org/1999/xhtml'>Look at <a href='about:blank'>nothing</a></body></html>", html.to_s)
end
|