summaryrefslogtreecommitdiff
blob: 0b5409f582bbe35ac90190df26b21bf3b6084008 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
commit 43f3b631484a2c0178e6699584471dedd598eca3
Author: Lee Jarvis <ljjarvis@gmail.com>
Date:   Mon May 6 19:39:25 2013 +0100

    Ensure we prefix xpath with // for searching entire document
    
    Tests prior to this commit passed because libxml2 was not so
    strict. Since upgrading to 2.9.0 this issue has been revealed.
    The former test should have been written with this in mind.
    
    Steps to reproduce (on OSX with Homebrew installed):
    
      gem uninstall nokogiri
      brew install libxml2
      LDFLAGS="-L/usr/local/opt/libxml2/lib" \
        CPPFLAGS="-I/usr/local/opt/libxml2/include" \
        gem install nokogiri
    
    closes #308

diff --git a/test/test_mechanize_xml_file.rb b/test/test_mechanize_xml_file.rb
index 58eb67c..bbe486c 100644
--- a/test/test_mechanize_xml_file.rb
+++ b/test/test_mechanize_xml_file.rb
@@ -23,7 +23,7 @@ class TestMechanizeXmlFile < Mechanize::TestCase
   end
 
   def test_at
-    assert_equal 'Perl', @xml.at('language[2]').text
+    assert_equal 'Perl', @xml.at('//language[2]').text
   end
 
 end
\ No newline at end of file