Sha256: b149ef3dcabad03534df847056b7432262d4e8e3856e3d574352f1c2b5896df1
Contents?: true
Size: 559 Bytes
Versions: 22
Compression:
Stored size: 559 Bytes
Contents
# coding: utf-8 require File.expand_path(::File.dirname(__FILE__) + '/../lib/xml/smart') require File.expand_path(::File.dirname(__FILE__) + '/smartrunner.rb') class TestSort < Minitest::Test def test_sort doc = XML::Smart.open(::File.dirname(__FILE__) + "/EXAMPLE.xml") nodes = doc.find("//names/name[@team>0]").sort{|a,b| a.to_s <=> b.to_s} assert(nodes[0].text == 'Egon') assert(nodes[1].text == 'Jürgen') assert(nodes[2].text == 'Kathrin ') assert(nodes[3].text == 'Michel') assert(nodes[4].text == 'Raphi') end end
Version data entries
22 entries across 22 versions & 1 rubygems