Sha256: 5943b370438aafb92a8ffcf1393f4411803146995deed79eff54e63169bf45b4
Contents?: true
Size: 636 Bytes
Versions: 22
Compression:
Stored size: 636 Bytes
Contents
require File.expand_path(::File.dirname(__FILE__) + '/../lib/xml/smart') require File.expand_path(::File.dirname(__FILE__) + '/smartrunner.rb') class TestAdd < MiniTest::Test def test_add nums = 50000 # Watch the power Minitest::PerformanceReporter::start_timing "Replace (#{nums} times)" doc = XML::Smart.open(::File.dirname(__FILE__) + "/EXAMPLE.xml") 0.upto(nums) { |i| nodes = doc.find("/test/names/name[6]") nodes.first.parent.add("name", { "team" => "2" }, "Egon") } Minitest::PerformanceReporter::end_timing assert(doc.find("/test/names/name").length == nums + 7) end end
Version data entries
22 entries across 22 versions & 1 rubygems