<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,8 +1,9 @@
-$LOAD_PATH &lt;&lt; File.expand_path(File.dirname(__FILE__) + &quot;/../lib&quot;)
+ROOT_DIR = File.expand_path(File.dirname(__FILE__) + &quot;/..&quot;)
+$LOAD_PATH &lt;&lt; &quot;#{ROOT_DIR}/lib&quot;
 require 'digest/md5'
 require 'mizuho/generator'
 
-CACHE_DIR = File.expand_path(File.dirname(__FILE__) + &quot;/cache&quot;)
+CACHE_DIR = &quot;#{ROOT_DIR}/test/cache&quot;
 
 def generate_and_parse(text)
 	Dir.mkdir(CACHE_DIR) if !File.exist?(CACHE_DIR)
@@ -27,7 +28,9 @@ def generate_and_parse(text)
 	output_filename = File.join(CACHE_DIR, Digest::MD5.hexdigest(text)) + &quot;.html&quot;
 	
 	# Generate Asciidoc output if it isn't cached, otherwise use cached version.
-	if !File.exist?(output_filename)
+	# Also check whether the cache is newer than Asciidoc; we want to invalidate
+	# the cache upon upgrading Asciidoc.
+	if !File.exist?(output_filename) || asciidoc_newer_than?(output_filename)
 		input_filename = File.join(CACHE_DIR, &quot;input.#{Process.pid}.txt&quot;)
 		begin
 			File.open(input_filename, 'w') do |f|
@@ -41,3 +44,8 @@ def generate_and_parse(text)
 	
 	return Mizuho::Parser.new(output_filename)
 end
+
+def asciidoc_newer_than?(filename)
+	asciidoc_mtime = File.stat(&quot;#{ROOT_DIR}/asciidoc/asciidoc.py&quot;).mtime
+	return asciidoc_mtime &gt; File.stat(filename).mtime
+end</diff>
      <filename>test/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>db1f99459f283b209b620695a7fd7789d30a7f01</id>
    </parent>
  </parents>
  <author>
    <name>Hongli Lai (Phusion)</name>
    <email>hongli@phusion.nl</email>
  </author>
  <url>http://github.com/FooBarWidget/mizuho/commit/d7fdf61b59e8c5d2bf37b62c43bce82c7b130ca6</url>
  <id>d7fdf61b59e8c5d2bf37b62c43bce82c7b130ca6</id>
  <committed-date>2009-01-08T16:56:27-08:00</committed-date>
  <authored-date>2009-01-08T16:56:27-08:00</authored-date>
  <message>Invalidate the unit test cache whenever Asciidoc is updated.</message>
  <tree>329c1f5ea1050dedc8360a356168bf86a59b7b1e</tree>
  <committer>
    <name>Hongli Lai (Phusion)</name>
    <email>hongli@phusion.nl</email>
  </committer>
</commit>
