<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -8,7 +8,13 @@ Autotest.add_hook :initialize do |at|
     filename 
   }
   at.add_mapping(%r%^lib/(.*)\.rb$%) { |_, m| 
-    [&quot;spec/#{m[1]}_spec.rb&quot;]
+    # two match entries to handle differences
+    # in directory structure:
+    # e.g lib/file.rb         =&gt; spec/file_spec.rb  - or  -
+    #     lib/module/file.rb  =&gt; spec/file_spec.rb
+    path1 = m[1]
+    path2 = m[1].split('/')[1..-1].join('/')
+    [&quot;spec/#{path1}_spec.rb&quot;, &quot;spec/#{path2}_spec.rb&quot;]
   }
   at.add_mapping(%r%^spec/(spec_helper|shared/.*)\.rb$%) { 
     at.files_matching %r%^spec/.*_spec\.rb$%</diff>
      <filename>lib/autotest/rspec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -82,14 +82,16 @@ HERE
     describe &quot;mappings&quot; do
     
       before(:each) do
-        @lib_file = &quot;lib/something.rb&quot;
+        @lib_files = [&quot;lib/something.rb&quot;, &quot;lib/module/something.rb&quot;]
         @spec_file = &quot;spec/something_spec.rb&quot;
         @rspec_autotest = Rspec.new
         @rspec_autotest.hook :initialize
       end
     
       it &quot;should find the spec file for a given lib file&quot; do
-        @rspec_autotest.should map_specs([@spec_file]).to(@lib_file)
+        @lib_files.each do |lib_file|
+          @rspec_autotest.should map_specs([@spec_file]).to(lib_file)
+        end
       end
     
       it &quot;should find the spec file if given a spec file&quot; do</diff>
      <filename>spec/autotest/rspec_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>466b8e27e36bb0e6073a460f01341882ee881d8c</id>
    </parent>
  </parents>
  <author>
    <name>John-Mason P. Shackelford</name>
    <email>jpshack@gmail.com</email>
  </author>
  <url>http://github.com/jpshackelford/rspec/commit/ac02c42058334f043ae948288e08a40ae37b7446</url>
  <id>ac02c42058334f043ae948288e08a40ae37b7446</id>
  <committed-date>2008-08-22T12:57:15-07:00</committed-date>
  <authored-date>2008-08-22T12:57:15-07:00</authored-date>
  <message>Autotest extension now supports lib/module convention. See LightHouse #506</message>
  <tree>6fceb4dc0a439218e14754eb237b9d28c46c849a</tree>
  <committer>
    <name>John-Mason P. Shackelford</name>
    <email>jpshack@gmail.com</email>
  </committer>
</commit>
