Sha256: 437294edd7b3679a3ce207582e35e2a1a85a9d9e2cabbd0e4d20e960668b115a
Contents?: true
Size: 575 Bytes
Versions: 22
Compression:
Stored size: 575 Bytes
Contents
require 'mechanize/test_case' class TestMechanizeXmlFile < Mechanize::TestCase def setup super uri = URI 'http://example.com/foo.xml' @xml = Mechanize::XmlFile.new uri, nil, <<-XML <languages> <language>Ruby</language> <language>Perl</language> </languages> XML end def test_xml assert_kind_of Nokogiri::XML::Document, @xml.xml end def test_search assert_equal ['Ruby', 'Perl'], @xml.search('language').map { |n| n.text } end def test_at assert_equal 'Perl', @xml.at('//language[2]').text end end
Version data entries
22 entries across 22 versions & 2 rubygems