Fixed tests to work with new hash return type from parse

Added ability to pass files to parse method
This commit is contained in:
Brian Miller 2011-06-15 11:40:17 -07:00
parent ce2ea993a8
commit f2921e82bb
2 changed files with 15 additions and 9 deletions

View file

@ -6,7 +6,7 @@ module Microformats2
VERSION = "1.0.0"
def self.parse(html)
raise LoadError unless html.is_a?(String)
raise LoadError unless [String, File].include?(html.class)
doc = Nokogiri::HTML(html)
microformats = Hash.new{|hash, key| hash[key] = Array.new}
doc.css("*[class^=h-]").each do |microformat|