<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -74,3 +74,57 @@ describe &quot;A table's width&quot; do
   end
 
 end
+
+class TableTextObserver
+  attr_accessor :font_settings, :size, :strings
+            
+  def initialize     
+    @font_settings = []
+    @fonts = {}
+    @strings = []
+  end
+  
+  def resource_font(*params)
+    @fonts[params[0]] = params[1].basefont
+  end
+
+  def set_text_font_and_size(*params)     
+    @font_settings &lt;&lt; { :name =&gt; @fonts[params[0]], :size =&gt; params[1] }
+  end     
+  
+  def show_text(*params)
+    @strings &lt;&lt; params[0]
+  end
+end
+
+
+describe &quot;A table's content&quot; do
+
+  it &quot;should output content cell by cell, row by row&quot; do
+    data = [[&quot;foo&quot;,&quot;bar&quot;],[&quot;baz&quot;,&quot;bang&quot;]]
+    @pdf = Prawn::Document.new
+    @pdf.table(data)
+    output = observer(TableTextObserver)
+    output.strings.should == data.flatten
+  end
+
+  it &quot;should add headers to output when specified&quot; do
+    data = [[&quot;foo&quot;,&quot;bar&quot;],[&quot;baz&quot;,&quot;bang&quot;]]
+    headers = %w[a b]
+    @pdf = Prawn::Document.new
+    @pdf.table(data, :headers =&gt; headers)
+    output = observer(TableTextObserver)
+    output.strings.should == headers + data.flatten
+  end
+
+  it &quot;should repeat headers across pages&quot; do
+    data = [[&quot;foo&quot;,&quot;bar&quot;]]*30
+    headers = [&quot;baz&quot;,&quot;foobar&quot;]
+    @pdf = Prawn::Document.new
+    @pdf.table(data, :headers =&gt; headers)
+    output = observer(TableTextObserver)
+    output.strings.should == headers + data.flatten[0..-3] + headers +
+      data.flatten[-2..-1]
+  end
+    
+end</diff>
      <filename>spec/table_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a9b66627259f2d42f41a1ca07d9432941f5f2d79</id>
    </parent>
  </parents>
  <author>
    <name>Gregory Brown</name>
    <email>gregory.t.brown@gmail.com</email>
  </author>
  <url>http://github.com/sandal/prawn/commit/4606d2d7b98a307ed7cb820d7ab4d06bd18f4059</url>
  <id>4606d2d7b98a307ed7cb820d7ab4d06bd18f4059</id>
  <committed-date>2008-06-25T11:24:19-07:00</committed-date>
  <authored-date>2008-06-25T11:24:19-07:00</authored-date>
  <message>Added cursory tests for content, this should be enough for a rough coverage net over tables, we'll fill in more specs as needed. [#32 state:resolved]</message>
  <tree>d74f4ce6bae33c097b882129ae1347e5b00481e0</tree>
  <committer>
    <name>Gregory Brown</name>
    <email>gregory.t.brown@gmail.com</email>
  </committer>
</commit>
