<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -43,6 +43,9 @@ module DirSpecs
                 #{mock_dir}/file_one.ext
                 #{mock_dir}/file_two.ext
 
+                #{mock_dir}/dir_filename_ordering
+                #{mock_dir}/dir/filename_ordering
+
                 #{mock_dir}/nondotfile
 
                 #{mock_dir}/subdir_one/.dotfile
@@ -86,6 +89,8 @@ module DirSpecs
       .dotfile
       .dotsubdir
       deeply
+      dir
+      dir_filename_ordering
       file_one.ext
       file_two.ext
       nondotfile</diff>
      <filename>1.8/core/dir/fixtures/common.rb</filename>
    </modified>
    <modified>
      <diff>@@ -30,6 +30,7 @@ describe &quot;Dir.glob&quot; do
       deeply/nested/
       deeply/nested/directory/
       deeply/nested/directory/structure/
+      dir/
       special/
       subdir_one/
       subdir_two/</diff>
      <filename>1.8/core/dir/glob_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,8 @@ shared :dir_glob do |cmd|
     it &quot;matches non-dotfiles with '*'&quot; do
       expected = %w[
         deeply
+        dir
+        dir_filename_ordering
         file_one.ext
         file_two.ext
         nondotfile
@@ -95,12 +97,14 @@ shared :dir_glob do |cmd|
     end
 
     it &quot;matches files with multiple '*' special characters&quot; do
-      Dir.send(cmd, '*fi*e*').sort.should == %w|nondotfile file_one.ext file_two.ext|.sort
+      Dir.send(cmd, '*fi*e*').sort.should == %w|dir_filename_ordering nondotfile file_one.ext file_two.ext|.sort
     end
 
     it &quot;matches non-dotfiles in the current directory with '**'&quot; do
       expected = %w[
         deeply
+        dir
+        dir_filename_ordering
         file_one.ext
         file_two.ext
         nondotfile
@@ -122,6 +126,7 @@ shared :dir_glob do |cmd|
         deeply/nested/
         deeply/nested/directory/
         deeply/nested/directory/structure/
+        dir/
         special/
         subdir_one/
         subdir_two/
@@ -188,14 +193,26 @@ shared :dir_glob do |cmd|
 
     it &quot;recursively matches directories with '**/&lt;characters&gt;'&quot; do
       %w|glob []|.each {|cmd|
-        Dir.send(cmd, '**/*fil?{,.}*').sort.should == %w|deeply/nested/directory/structure/file_one 
-                                                         deeply/nested/directory/structure/file_one.ext 
-                                                         deeply/nondotfile file_one.ext file_two.ext 
-                                                         nondotfile subdir_one/nondotfile 
-                                                         subdir_two/nondotfile subdir_two/nondotfile.ext 
+        Dir.send(cmd, '**/*fil?{,.}*').sort.should == %w|deeply/nested/directory/structure/file_one
+                                                         deeply/nested/directory/structure/file_one.ext
+                                                         deeply/nondotfile
+                                                         dir/filename_ordering
+                                                         dir_filename_ordering
+                                                         file_one.ext file_two.ext
+                                                         nondotfile subdir_one/nondotfile
+                                                         subdir_two/nondotfile
+                                                         subdir_two/nondotfile.ext
                                                          subdir_two/nondotfile.ext|
       }
     end
+
+    it &quot;orders directory-based entries before files when a glob matches both&quot; do
+      expected = %w[dir/filename_ordering dir_filename_ordering]
+      %w|glob []|.each do |cmd|
+        Dir.send(cmd, '**/*filename_ordering').should == expected
+      end
+    end
+
     after(:all) do
       Dir.chdir @cwd
     end</diff>
      <filename>1.8/core/dir/shared/glob.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>68b51a512dcca1e853a98f648957775b8ee7c060</id>
    </parent>
  </parents>
  <author>
    <name>Nick Sieger</name>
    <login></login>
    <email>nick@nicksieger.com</email>
  </author>
  <url>http://github.com/brixen/rubyspec/commit/799fd9dc4e9b6d731d4d789687ee46d2949c3270</url>
  <id>799fd9dc4e9b6d731d4d789687ee46d2949c3270</id>
  <committed-date>2008-05-14T06:57:15-07:00</committed-date>
  <authored-date>2008-05-14T06:57:15-07:00</authored-date>
  <message>Add Dir.glob ordering spec when two entries share common sub paths</message>
  <tree>25f0118d5379423ad270cda2f7bad41f53ff0fa3</tree>
  <committer>
    <name>Nick Sieger</name>
    <login></login>
    <email>nick@nicksieger.com</email>
  </committer>
</commit>
