Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Delegate background_color to the master_cell [closes #412]

  • Loading branch information...
commit bee7cd939596eb1ec92ee460642bae7450f0730e 1 parent e88be6d
@jordanbyron jordanbyron authored
View
3  lib/prawn/table/cell/span_dummy.rb
@@ -13,6 +13,9 @@ class Cell
# group.
#
class SpanDummy < Cell
+ extend Forwardable
+ def_delegator :@master_cell, :background_color
+
def initialize(pdf, master_cell)
super(pdf, [0, pdf.cursor])
@master_cell = master_cell
View
17 spec/table/span_dummy_spec.rb
@@ -0,0 +1,17 @@
+# encoding: utf-8
+
+require File.join(File.expand_path(File.dirname(__FILE__)), "..", "spec_helper")
+require 'set'
+
+describe "Prawn::Table::Cell::SpanDummy" do
+ before(:each) do
+ @pdf = Prawn::Document.new
+ @table = @pdf.table([[{:content => "Row", :colspan => 2}]])
+ @master_cell = @table.cells[0,0]
+ @span_dummy = @master_cell.dummy_cells.first
+ end
+
+ it "delegates background_color to the master cell" do
+ @span_dummy.background_color.should == @master_cell.background_color
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.