Sha256: 5d713e9c2df887bf686d1de0d45bf911e6c0f6af9c49b3604f82e9752598931a

Contents?: true

Size: 739 Bytes

Versions: 2

Compression:

Stored size: 739 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Prawn::Document do
  describe 'A Reference object' do
    describe 'generated via Prawn::Document' do
      it 'returns a proper reference on ref!' do
        pdf = described_class.new
        expect(pdf.ref!({}).is_a?(PDF::Core::Reference)).to eq(true)
      end

      it 'returns an identifier on ref' do
        pdf = described_class.new
        r = pdf.ref({})
        expect(r.is_a?(Integer)).to eq(true)
      end

      it 'has :Length of stream if it has one when compression disabled' do
        pdf = described_class.new compress: false
        ref = pdf.ref!({})
        ref << 'Hello'
        expect(ref.stream.data[:Length]).to eq(5)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
prawn-2.4.0 spec/prawn/document_reference_spec.rb
prawn-2.3.0 spec/prawn/document_reference_spec.rb