spec/spec_helper.rb in xml-sitemap-1.1.2 vs spec/spec_helper.rb in xml-sitemap-1.1.3

- old
+ new

@@ -3,14 +3,29 @@ require 'simplecov' SimpleCov.start do add_group 'XmlSitemap', 'lib/xml-sitemap' end +require 'digest' require 'xml-sitemap' def fixture_path File.expand_path("../fixtures", __FILE__) end def fixture(file) File.read(File.join(fixture_path, file)) +end + +def checksum(content) + Digest::SHA1.hexdigest(content) +end + +def gunzip(path) + contents = nil + File.open(path) do |f| + gz = Zlib::GzipReader.new(f) + contents = gz.read + gz.close + end + contents end