Skip to content

Instantly share code, notes, and snippets.

@maliqq
Created April 23, 2009 04:32
Show Gist options
  • Save maliqq/100312 to your computer and use it in GitHub Desktop.
Save maliqq/100312 to your computer and use it in GitHub Desktop.
# test/html/test_element.rb
module Nokogiri
module HTML
class TestElement < Nokogiri::TestCase
def test_line
html = Nokogiri::HTML(<<-eohtml)
<html>
<head>
<title>title</title>
</head>
<body>
Hello world
</body>
</html>
eohtml
assert_equal html.search("/html/head/title")[0], 3
assert_equal html.search("/html/body")[0], 5
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment