From ff556ab648670caccfbf9a5e3df99feb4ab0f40d Mon Sep 17 00:00:00 2001 From: Jessica Lynn Suttles Date: Thu, 14 Feb 2013 14:44:18 -0800 Subject: [PATCH] runs all specs from microformats node --- spec/lib/microformats2/collection_spec.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/lib/microformats2/collection_spec.rb b/spec/lib/microformats2/collection_spec.rb index d07f918..2aeeb49 100644 --- a/spec/lib/microformats2/collection_spec.rb +++ b/spec/lib/microformats2/collection_spec.rb @@ -2,17 +2,17 @@ require "spec_helper" require "microformats2" describe Microformats2::Collection do - describe "programatic case" do - cases_dir = "spec/support/cases/microformats.org/microformats-2" - html_files = Dir.entries(cases_dir).keep_if { |f| f =~ /([.]html$)/ } + describe "case" do + cases_dir = "spec/support/cases/*" + 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| - 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) + JSON.parse(Microformats2.parse(html).to_json).should == JSON.parse(json) + end end end end