adds programatically generated spec cases
This commit is contained in:
parent
506ae94adb
commit
241b9ffbd3
1 changed files with 15 additions and 0 deletions
|
@ -27,4 +27,19 @@ describe Microformats2 do
|
|||
Microformats2.read_html(html).should include "google"
|
||||
end
|
||||
end
|
||||
|
||||
describe "programatic case" do
|
||||
cases_dir = "spec/support/cases"
|
||||
html_files = Dir.entries(cases_dir).keep_if { |f| f =~ /([.]html$)/ }
|
||||
|
||||
html_files.each do |html_file|
|
||||
it "#{html_file}" do
|
||||
json_file = html_file.gsub(/([.]html$)/, ".js")
|
||||
html = open(File.join(cases_dir, html_file)).read
|
||||
json = open(File.join(cases_dir, json_file)).read
|
||||
|
||||
JSON.parse(Microformats2.parse(html).to_json).should == JSON.parse(json)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue