From 91ed484f92040e5c2006a3a00ec77a54d552cf37 Mon Sep 17 00:00:00 2001 From: kou Date: Fri, 17 Sep 2010 13:14:14 +0000 Subject: * test/rexml/: import REXML tests from http://www.germane-software.com/repos/rexml/trunk/test/. Many tests are failed temporary. I'll fix them quickly. Sorry. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rexml/test_preceding_sibling.rb | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 test/rexml/test_preceding_sibling.rb (limited to 'test/rexml/test_preceding_sibling.rb') diff --git a/test/rexml/test_preceding_sibling.rb b/test/rexml/test_preceding_sibling.rb new file mode 100644 index 0000000000..c892b9400e --- /dev/null +++ b/test/rexml/test_preceding_sibling.rb @@ -0,0 +1,40 @@ +# ISSUE 32 +require 'test/unit' +require 'rexml/document' + +p [REXML::VERSION, RUBY_VERSION, RUBY_RELEASE_DATE] + +# daz - for report by Dan Kohn in: +# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/156328 +class XPathTesterDd < Test::Unit::TestCase + include REXML + + def setup + @@docDd = Document.new(<<-EOS, :ignore_whitespace_nodes => :all) + + + Success + + + abc02C + + + EOS + end + + def test_Dd_preceding_sibling_children + arr = [] + XPath.each(@@docDd, "//b[@x='ab02A']/preceding-sibling::b/child::*") do |cell| + arr << cell.texts.join + end + assert_equal( 'Success', arr.join ) + end + + def test_Dd_preceding_sibling_all + arr = [] + XPath.each(@@docDd, "//b[@x='ab02A']/preceding-sibling::*") do |cell| + arr << cell.to_s + end + assert_equal( "Success", arr.join ) + end +end -- cgit v1.2.3