File: api_spec.rb

package info (click to toggle)
ruby-asciidoctor-pdf 2.3.19-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,972 kB
  • sloc: ruby: 44,316; sh: 133; java: 45; makefile: 4
file content (24 lines) | stat: -rw-r--r-- 804 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

require_relative 'spec_helper'

describe 'API' do
  context 'Asciidoctor.convert' do
    it 'should return an instance of Prawn::Document' do
      output = to_pdf 'hello', analyze: :document
      (expect output).to be_a Asciidoctor::PDF::Converter
      (expect output).to be_a Prawn::Document
      (expect output.render).to start_with '%PDF'
    end
  end

  context 'Asciidoctor.convert_file' do
    it 'should return a doc whose converter is a Prawn::Document' do
      input_file = Pathname.new fixture_file 'hello.adoc'
      output = to_pdf input_file, to_dir: output_dir, analyze: :document
      (expect output).to be_a Asciidoctor::PDF::Converter
      (expect output).to be_a Prawn::Document
      (expect output.render).to start_with '%PDF'
    end
  end
end