File: span_dummy_spec.rb

package info (click to toggle)
ruby-prawn-table 0.2.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 528 kB
  • sloc: ruby: 3,355; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 900 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 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 => "A1-2", :colspan => 2}, {:content => "A-B3", :rowspan => 2}],
        [{:content => "B1-2", :colspan => 2}]
    ], :row_colors => [nil, 'EFEFEF'])
    @colspan_master = @table.cells[0,0]
    @colspan_dummy = @colspan_master.dummy_cells.first
    @rowspan_master = @table.cells[0,2]
    @rowspan_dummy = @table.cells[1,2]
  end

  it "colspan dummy delegates background_color to the master cell" do
    @colspan_dummy.background_color.should == @colspan_master.background_color
  end

  it "rowspan dummy delegates background_color to the master cell" do
    @rowspan_dummy.background_color.should == @rowspan_master.background_color
  end
end