Sha256: ff6ebbe31edfb973164954e190411af8590266109a5bb2f39b794e1506766bf6
Contents?: true
Size: 601 Bytes
Versions: 22
Compression:
Stored size: 601 Bytes
Contents
require File.expand_path(::File.dirname(__FILE__) + '/../lib/xml/smart') require File.expand_path(::File.dirname(__FILE__) + '/smartrunner.rb') class TestWrite < Minitest::Test def test_write tim = Time.now # When a closure is used, then the changes are written back to the disk XML::Smart.modify(::File.dirname(__FILE__) + "/EXAMPLE.xml") do |doc| node = doc.root.find("/test/names/name")[0] node.text = tim end # Print the document assert(XML::Smart.open(::File.dirname(__FILE__) + "/EXAMPLE.xml").find("string(/test/names/name)") == tim.to_s) end end
Version data entries
22 entries across 22 versions & 1 rubygems