class TestTemplate
Public Instance Methods
apply_template(data, template)
click to toggle source
# File vendor/qwik/lib/qwik/template.rb, line 58 def apply_template(data, template) xml = @memory.template.get(template) xml.apply(data) end
test_all()
click to toggle source
# File vendor/qwik/lib/qwik/template.rb, line 63 def test_all # setup config @config = defined?($test_config) ? $test_config : Qwik::Config.new # setup memory @memory = defined?($test_memory) ? $test_memory : Qwik::ServerMemory.new(@config) # test_non_destructive template = @memory.template.get('notice') id1 = template.object_id head = template.get_tag(:head) length1 = head.length head << [:title, 'title'] # destructive method template = @memory.template.get('notice') id2 = template.object_id assert_not_equal(id1, id2) head = template.get_tag(:head) length2 = head.length ok_eq(length2, length1) end