Sha256: 30b9e977691dc562e279a9e07ad6a0d8bddc26873b6564c479ac5e308ab95e68

Contents?: true

Size: 1.1 KB

Versions: 4

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

require 'test_helper'

class Thinreports::TestConfig < Minitest::Test
  include Thinreports::TestHelper

  def test_config_should_return_configuration_of_thinreports
    assert_instance_of Thinreports::Configuration, Thinreports.config
  end

  def test_configure_should_exec_an_given_block_with_config_which_instance_of_Configuration
    Thinreports.configure do |config|
      assert_instance_of Thinreports::Configuration, config
    end
  end

  def test_fallback_fonts
    config = Thinreports::Configuration.new

    # should be empty by default
    assert_empty config.fallback_fonts

    config.fallback_fonts = 'Helvetica'
    assert_equal config.fallback_fonts, ['Helvetica']

    config.fallback_fonts = ['/path/to/font.ttf', 'Courier New']
    assert_equal config.fallback_fonts, ['/path/to/font.ttf', 'Courier New']

    config.fallback_fonts = []
    config.fallback_fonts << 'Helvetica'
    config.fallback_fonts << 'IPAMincho'
    config.fallback_fonts.unshift 'Times New Roman'
    assert_equal config.fallback_fonts, ['Times New Roman', 'Helvetica', 'IPAMincho']
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
thinreports-0.10.3 test/units/test_config.rb
thinreports-0.10.2 test/unit/test_config.rb
thinreports-0.10.1 test/unit/test_config.rb
thinreports-0.10.0 test/unit/test_config.rb