Skip to content

Commit

Permalink
Added a test case to represent the issue described in #1109.
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed May 20, 2014
1 parent 492ee64 commit 7808fcd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/xml/test_xpath.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ def test_slow_jruby_xpath
assert_send [elapsed_time, :<, time_limit], "XPath is taking too long"
end

# issue #1109 (jruby impl's xpath() cache not being cleared )
def test_xpath_results_cache_should_get_cleared
doc = Nokogiri::HTML("<html><div selected></div></html>")
element = doc.at_xpath('//div[@selected]')
element.remove_attribute('selected')
assert_nil doc.at_xpath('//div[@selected]')
end

def test_custom_xpath_function_returns_string
if Nokogiri.uses_libxml?
result = @xml.xpath('thing("asdf")', @handler)
Expand Down

0 comments on commit 7808fcd

Please sign in to comment.