Sha256: 5e7ffa1042f1bfec0bc56f5604810c963c135ed5c7749f1de2e36045d2766b37

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.7.0 test/unit/generator/pdf/document/test_graphics.rb