Sha256: 341443153ab108dee31512a003b90c18798d30543eb31c909799c742a65787b8

Contents?: true

Size: 1001 Bytes

Versions: 1

Compression:

Stored size: 1001 Bytes

Contents

# coding: utf-8

require 'test/unit/helper'

class ThinReports::Generator::Pdf::TestGraphics < MiniTest::Unit::TestCase
  include ThinReports::TestHelpers
  
  class TestGraphics
    attr_accessor :pdf
    include ThinReports::Generator::Pdf::Graphics
  end
  
  def setup
    @g     = TestGraphics.new
    @g.pdf = flexmock('pdf')
  end
  
  def test_setup_custom_graphic_states
    @g.pdf.
      should_receive(:line_width).
      with(TestGraphics::BASE_LINE_WIDTH).once
    
    @g.send(:setup_custom_graphic_states)
  end
  
  def test_line_width
    @g.pdf.
      should_receive(:line_width).
      with(10 * TestGraphics::BASE_LINE_WIDTH).once
    
    @g.send(:line_width, 10)
  end
  
  def test_save_graphics_state
    @g.pdf.should_receive(:save_graphics_state).once
    @g.send(:save_graphics_state)
  end
  
  def test_restore_graphics_state
    @g.pdf.should_receive(:restore_graphics_state).once
    @g.send(:restore_graphics_state)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thinreports-0.6.0.pre3 test/unit/generator/pdf/document/test_graphics.rb