runs all specs from microformats node
This commit is contained in:
parent
fb7cc7f2eb
commit
ff556ab648
1 changed files with 10 additions and 10 deletions
|
@ -2,17 +2,17 @@ require "spec_helper"
|
||||||
require "microformats2"
|
require "microformats2"
|
||||||
|
|
||||||
describe Microformats2::Collection do
|
describe Microformats2::Collection do
|
||||||
describe "programatic case" do
|
describe "case" do
|
||||||
cases_dir = "spec/support/cases/microformats.org/microformats-2"
|
cases_dir = "spec/support/cases/*"
|
||||||
html_files = Dir.entries(cases_dir).keep_if { |f| f =~ /([.]html$)/ }
|
Dir[File.join(cases_dir, "*")].each do |page_dir|
|
||||||
|
Dir[File.join(page_dir, "*")].keep_if { |f| f =~ /([.]html$)/ }.each do |html_file|
|
||||||
|
it "#{html_file}" do
|
||||||
|
json_file = html_file.gsub(/([.]html$)/, ".js")
|
||||||
|
html = open(html_file).read
|
||||||
|
json = open(json_file).read
|
||||||
|
|
||||||
html_files.each do |html_file|
|
JSON.parse(Microformats2.parse(html).to_json).should == JSON.parse(json)
|
||||||
it "#{html_file}" do
|
end
|
||||||
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
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue