Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Web Development &amp; Programming Thoughts</title>
<meta name="description" content="Timothy Elliott's Technical Blog" />
<meta name="keywords" content="Web Development, Programming" />
<style>
body {
background-color: #EEE;
}
h1 {
margin-bottom: 0;
}
h2 {
border-bottom: 1px solid #000;
font-size: 0.8em;
font-weight: normal;
padding-bottom: 1em;
margin-top: 0;
}
</style>
</head>
<body>
<h1>Web Development &amp; Programming Thoughts</h1>
<h2>By Timothy Elliott</h2>
</body>
</html>
require "helper"
module Nokogiri
module HTML
class TestDocument < Nokogiri::TestCase
def setup
super
@html = Nokogiri::HTML.parse(File.read(HTML_FILE))
end
def test_parse_same_as_read_io
File.open(File.join(ASSETS_DIR, 'template.html'), 'rb') do |f|
doc_read_io = Document.read_io(f, nil, nil, XML::ParseOptions::DEFAULT_HTML)
f.rewind
doc_parse = Nokogiri::HTML.parse(f)
assert_equal doc_read_io.to_html.size, doc_parse.to_html.size
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.