<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -14,8 +14,12 @@ module HappyTitles
     content_tag(:title, render_title_template(template_key))
   end
   
-  def title(page_title)
-    @page_title = h(page_title.gsub(/&lt;\/?[^&gt;]*&gt;/, '')) if page_title
+  def title(page_title = nil)
+    if page_title
+      @page_title = h(page_title.gsub(/&lt;\/?[^&gt;]*&gt;/, '')) if page_title
+    else
+      @page_title || ''
+    end
   end
   
   def self.included(base)</diff>
      <filename>lib/happy_titles.rb</filename>
    </modified>
    <modified>
      <diff>@@ -120,7 +120,7 @@ describe 'Happy Titles!' do
     
     it 'should set the title' do
       @view.title(&quot;Happy Title!&quot;)
-      @view.send(:page_title).should eql(&quot;Happy Title!&quot;)
+      @view.send(:page_title).should == &quot;Happy Title!&quot;
     end
     
     it 'should overwrite a privously set title' do
@@ -146,6 +146,24 @@ describe 'Happy Titles!' do
     
   end
   
+  describe 'reading the title method' do
+    
+    it 'should return an empty string when called with no args' do
+      @view.title.should == ''
+    end
+    
+    it 'should return @page_title when @page_title is set and is called with no args' do
+      @view.title('Happy Title!')
+      @view.title.should == 'Happy Title!'
+    end
+    
+    it 'should not set the title when called with no args' do
+      @view.title
+      @view.happy_title.should have_tag('title', 'My Site | My short, descriptive and witty tagline')
+    end
+    
+  end
+  
   describe 'showing the title' do
     
     it 'should output a valid title element' do</diff>
      <filename>spec/happy_titles_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bf73b48c8f11e56067f679df96a475aaabf7281c</id>
    </parent>
  </parents>
  <author>
    <name>Andy Pearson</name>
    <email>andy@andy-pearson.com</email>
  </author>
  <url>http://github.com/andypearson/happy-titles/commit/49c3accb89a14f5faa00314a099150a0f6409024</url>
  <id>49c3accb89a14f5faa00314a099150a0f6409024</id>
  <committed-date>2009-03-19T11:33:38-07:00</committed-date>
  <authored-date>2009-03-19T11:33:38-07:00</authored-date>
  <message>Updating the title method so it returns the current page_title or an empty string when called with no arguments</message>
  <tree>2406c1103cba767e41d79ea15e60603a3018c4cc</tree>
  <committer>
    <name>Andy Pearson</name>
    <email>andy@andy-pearson.com</email>
  </committer>
</commit>
