From: Tobias Reif Date: 2002-03-21T20:34:26+09:00 Subject: Re: ANN: REXML 2.0 Stefan Scholl wrote: >>At least post some code :) >> > The code isn't free. You can't post the XPath, and some dummy XML fragment/doc? >>(a tiny RUnit test for an existing problematic XPath shouldn't take more >> > Learning how to use RUnit costs more time. Cost me 10 minuts as well. Install RUNit, check http://www.eng.dmu.ac.uk/~hgs/ruby/ruby-unit.html , , then use this as skeleton: --- require 'runit/testcase' require 'runit/cui/testrunner' require 'runit/testsuite' $:.unshift "rexml/2.0/" require 'rexml/document' include REXML class REXML_tests < RUNIT::TestCase XML_STRING_01 = < Thomas, David; Hunt, Andrew english Addison-Wesley Programming Ruby. The Pragmatic Programmer's Guide 2000 Blammo, Blah english Hubbabubba Foozboozer's Life Book 2002 DELIMITER #this first test succeeds, to check if stuff is set up correctly def test_xpath_01 doc = Document.new XML_STRING_01.dup desired_result = Document.new 'Thomas, David; Hunt, Andrew' xpath = '//author' result = XPath.first(doc, xpath) assert_equal desired_result.to_s, result.to_s end end puts 'Ruby '+RUBY_VERSION+', REXML '+Version+' RUNIT::CUI::TestRunner.run(REXML_tests.suite) ---- simply run this file. Tobi -- * peace&love. * http://www.pinkjuice.com/