Sha256: 9c3aa5f49127d2b6eeae4b7a564084af081e17a99ebfe72fa6922868ced0f570
Contents?: true
Size: 1009 Bytes
Versions: 50
Compression:
Stored size: 1009 Bytes
Contents
require "helper" if defined?(Nokogiri::LibXML) class FFI::TestDocument < Nokogiri::TestCase def test_ruby_doc_reflection doc = Nokogiri::XML("<root><foo>foo</foo></root>") assert_equal doc, doc.cstruct.ruby_doc end def test_ruby_doc_setter doc = Nokogiri::XML("<root><foo>foo</foo></root>") foo = "foobar" doc.cstruct.ruby_doc = foo assert_equal foo, doc.cstruct.ruby_doc end def test_unlinked_nodes doc = Nokogiri::XML("<root><foo>foo</foo></root>") assert_instance_of Nokogiri::LibXML::XmlNodeSetCast, doc.cstruct.unlinked_nodes end def test_unlinked_nodes_contains_unlinked_nodes doc = Nokogiri::XML("<root><foo>foo</foo></root>") node = doc.xpath('//foo').first assert_equal 0, doc.cstruct.unlinked_nodes[:nodeNr] node.unlink assert_equal 1, doc.cstruct.unlinked_nodes[:nodeNr] assert_equal node.cstruct.pointer, doc.cstruct.unlinked_nodes[:nodeTab].get_pointer(0) end end end
Version data entries
50 entries across 50 versions & 9 rubygems