Created
June 27, 2011 21:26
-
-
Save ender672/1049877 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Web Development & 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 & Programming Thoughts</h1> | |
<h2>By Timothy Elliott</h2> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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