<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/example_site/pages/partials/common/_footer.html.erb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -12,15 +12,14 @@ class Bones
     end
     
     # Path to the root of the bones project
-    # Defaults to current directory
     def root
-      @root ||= File.expand_path(File.dirname(__FILE__) + '/../../')
+      @root ||= Pathname.new(__FILE__).dirname.dirname.expand_path.to_s
     end
     
     # Path to the bones system files
-    # Defaults to the directory containing this file
+    # Defaults to the lib
     def system_path
-      @system_path ||= File.expand_path(File.dirname(File.dirname(__FILE__)))
+      @system_path ||= Pathname.new(__FILE__).dirname.dirname.expand_path.to_s
     end
     
     # Path to the directory containing the page templates</diff>
      <filename>lib/bones/bones.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 require 'rubygems'
 require 'activesupport'
 require 'rack'
-require File.join(File.dirname(__FILE__), 'bones.rb')
-require File.join(File.dirname(__FILE__), 'extensions.rb')
+require 'pathname'
+require Pathname.new(__FILE__).dirname.join('bones.rb')
+require Pathname.new(__FILE__).dirname.join('extensions.rb')
 
 ActiveSupport::Dependencies.load_paths.push Bones.system_path
 $:.push Bones.system_path</diff>
      <filename>lib/bones/boot.rb</filename>
    </modified>
    <modified>
      <diff>@@ -85,7 +85,7 @@ class Bones
       
       src = ERB.new(File.read(filename)).src
       src = (local_assigns_source || '') + (src || '')
-      @content_for_layout = eval(src) # erb.result(binding)
+      @content_for_layout = eval(src)
       
       if layout &amp;&amp; File.file?(layout_filename)
         erb = ERB.new(File.read(layout_filename))
@@ -118,7 +118,7 @@ class Bones
     # the '_footer.html.erb' template.
     def partial(name, options={})
       path = name.to_s.split('/')
-      path[-1] = '_' + path.last unless path.last.starts_with?('_')
+      path.last.gsub!(/^([^_])/, '_\1')
       name = path.join('/')
       template = Template.new(name, false, options)
       template.request = request</diff>
      <filename>lib/bones/template.rb</filename>
    </modified>
    <modified>
      <diff>@@ -53,7 +53,8 @@ Gem::Specification.new do |s|
     'test/example_site/pages/about.html.erb',
     'test/example_site/pages/index.html.erb',
     'test/example_site/pages/partials',
-    'test/example_site/pages/partials/_footer.html.erb',
+    'test/example_site/pages/partials/common',
+    'test/example_site/pages/partials/common/_footer.html.erb',
     'test/example_site/pages/things',
     'test/example_site/pages/things/a.html.erb',
     'test/example_site/public',</diff>
      <filename>scharfie-bones.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
 Example Layout
 &lt;%= yield %&gt;
 &lt;%= yield :name %&gt;
+&lt;%= partial 'partials/common/footer' %&gt;
\ No newline at end of file</diff>
      <filename>test/example_site/layouts/example_layout.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,6 @@
 &lt;/head&gt;
 &lt;body&gt;  
   &lt;a href=&quot;/things/a&quot;&gt;Thing A&lt;/a&gt;
-  &lt;form action=&quot;/comment&quot;&gt;&lt;/form&gt; 
+  &lt;form action=&quot;/comment&quot;&gt;&lt;/form&gt;
 &lt;/body&gt;
 &lt;/html&gt;
\ No newline at end of file</diff>
      <filename>test/example_site/pages/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -2,10 +2,10 @@ require File.dirname(__FILE__) + '/test_helper'
 
 context 'Bones' do
   test &quot;should have proper paths&quot; do
-    assert_equal relative_path('../..'),         Bones.root
-    assert_equal relative_path('../lib'),        Bones.system_path
-    assert_equal relative_path('../../pages'),   Bones.pages_path
-    assert_equal relative_path('../../layouts'), Bones.layouts_path
+    assert_equal relative_path('../lib'),         Bones.root
+    assert_equal relative_path('../lib'),         Bones.system_path
+    assert_equal relative_path('../lib/pages'),   Bones.pages_path
+    assert_equal relative_path('../lib/layouts'), Bones.layouts_path
   end
   
   test &quot;should allow getting/setting Bones.base&quot; do</diff>
      <filename>test/test_bones.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,6 +14,23 @@ context &quot;Bones::Cache with default options&quot; do
     assert_include @page, 'href=&quot;/things/a.html&quot;'
   end
 end
+
+context 'Bones::Cache with default options, layout' do
+  uses_example_site
+  
+  setup do
+    @cache = Bones::Cache.new
+    @page = @cache.process_page('about')
+  end
+  
+  test &quot;should have layout&quot; do
+    assert_include @page, 'Example Layout'
+  end
+
+  test &quot;should have footer&quot; do
+    assert_include @page, 'Footer text'
+  end
+end
   
 context &quot;Bones::Cache with custom base&quot; do
   uses_example_site</diff>
      <filename>test/test_cache.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 $:.unshift(File.dirname(__FILE__) + '/../')
-require 'lib/boot'
+require 'lib/bones/boot'
 require 'test/unit'
 
 class String
@@ -18,8 +18,7 @@ end
 
 def context(name, &amp;block)
   Object.const_set(name.to_s.to_test_class_name, Class.new(Test::Unit::TestCase, &amp;block))
-end 
-
+end
 
 class Test::Unit::TestCase
   class &lt;&lt; self; attr_accessor :bones_root; end
@@ -38,7 +37,7 @@ class Test::Unit::TestCase
   # end
   
   def self.uses_example_site
-    self.bones_root = File.expand_path(File.dirname(__FILE__) / 'example_site')
+    self.bones_root = Pathname.new(__FILE__).dirname.join('example_site').expand_path.to_s
   end
 
   def run_with_bones_root(*args, &amp;block)
@@ -56,10 +55,11 @@ class Test::Unit::TestCase
   end
   
   def relative_path(path)
-    File.expand_path(File.dirname(__FILE__) / path)
+    Pathname.new(__FILE__).dirname.join(path).expand_path.to_s
   end
   
   def assert_include(collection, obj, message=nil)
+    message ||= &quot;expected #{collection.inspect} to include #{obj.inspect}&quot;
     assert collection.include?(obj), message
   end
 end</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -31,8 +31,9 @@ context &quot;Bones Template&quot; do
     assert_include @template.some_custom_helper, 'Some custom helper'
   end
   
-  test &quot;should render partial partials/footer&quot; do
-    assert_include @template.partial('partials/footer'), 'Footer text'
+  test &quot;should render partial partials/common/footer&quot; do
+    # @template.layout = 'example_layout'
+    assert_include @template.partial('partials/common/footer'), 'Footer text'
   end
   
 end</diff>
      <filename>test/test_template.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>test/example_site/pages/partials/_footer.html.erb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>5da4769c7a50d6bf12e5413a11c85d23ad15c44a</id>
    </parent>
  </parents>
  <author>
    <name>Chris Scharf</name>
    <email>scharfie@gmail.com</email>
  </author>
  <url>http://github.com/scharfie/bones/commit/a5579ed2f9f3417b152625b6bdce044f78ac8920</url>
  <id>a5579ed2f9f3417b152625b6bdce044f78ac8920</id>
  <committed-date>2009-10-25T03:37:06-07:00</committed-date>
  <authored-date>2009-10-25T03:37:06-07:00</authored-date>
  <message>testing</message>
  <tree>8335669af1f8a981c5dc238b68d0124906649d4c</tree>
  <committer>
    <name>Chris Scharf</name>
    <email>scharfie@gmail.com</email>
  </committer>
</commit>
