What's wrong with my index.rhtml?

Hi,
     When I use some eruby examples from the PickAxe book as my index.rhtml file, the page loads. When my index.rhtml file contains the following, I get a server error 500:

<% Dir.glob("*") do |i| %>
   <% if test(?d, i) %>
     <tr>
       <td><%= i %></td>
         <td align="right"><a href="<%= i %>/index.html"><%= i %></

</td>

       </tr>
   <% end %>
<% end %>

I think the problem lies with test(). I noticed the same thing happens with File.stat() and File.directory?(). Any ideas as to what's failing or suggestions?

Thanks,
Ryan