File: base_spec.rb

package info (click to toggle)
ruby-prawn-icon 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 3,228 kB
  • sloc: ruby: 1,370; makefile: 5
file content (34 lines) | stat: -rw-r--r-- 913 bytes parent folder | download
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
27
28
29
30
31
32
33
34
# encoding: utf-8
#
# Copyright September 2016, Jesse Doyle. All rights reserved.
#
# This is free software. Please see the LICENSE and COPYING files for details.

describe Prawn::Icon do
  describe '#configuration' do
    it 'returns an instance of Prawn::Icon::Configuration' do
      expect(described_class.configuration).to be_a(Prawn::Icon::Configuration)
    end
  end

  describe '#configure' do
    around(:each) do |example|
      old = described_class.configuration.dup
      described_class.configure do |config|
        config.font_directory = '/tmp/fonts'
      end
      example.run
      described_class.configuration = old
    end

    it 'yields control' do
      expect { |b| described_class.configure(&b) }.to yield_control
    end

    it 'configures properties' do
      expect(described_class.configuration.font_directory).to eq(
        Pathname.new('/tmp/fonts')
      )
    end
  end
end