Sha256: dfe9cd34ad536b337457e5f0788ecd6d744a9afa4406ddec7281e4939a031372

Contents?: true

Size: 497 Bytes

Versions: 4

Compression:

Stored size: 497 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

class Thinreports::Generator::PrawnExt::TestWidthOf < Minitest::Test
  def setup
    @pdf = Prawn::Document.new
  end

  def test_width_of
    text_width = @pdf.width_of('abcd')

    @pdf.character_spacing(1) do
      expected_character_space_width = 1 * 3
      assert_equal text_width + expected_character_space_width, @pdf.width_of('abcd')
    end

    @pdf.character_spacing(1) do
      assert_equal 0, @pdf.width_of('')
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
thinreports-0.10.3 test/units/generator/pdf/prawn_ext/test_width_of.rb
thinreports-0.10.2 test/unit/generator/pdf/prawn_ext/test_width_of.rb
thinreports-0.10.1 test/unit/generator/pdf/prawn_ext/test_width_of.rb
thinreports-0.10.0 test/unit/generator/pdf/prawn_ext/test_width_of.rb