Sha256: 64596f0c28624ca7f16b1cc45e8128c0cb1139b273784826c1cf719b8ffbc1ef

Contents?: true

Size: 833 Bytes

Versions: 1

Compression:

Stored size: 833 Bytes

Contents

require 'spec_helper'

describe "DotGrid::Generator" do
  describe "#initialize" do
    let(:subject) { DotGrid::Generator.new({}) }

    it "has a default file name" do
      expect(subject.file_name).to eq("dotgrid.pdf")
    end

    it "has a default file page size" do
      expect(subject.page_size).to eq("LETTER")
    end

    it "has a default file margin" do
      expect(subject.margin).to eq(0.5)
    end

    it "creates a pdf file" do
      expect(subject.pdf).to be_a(Prawn::Document)
    end

    it "creates the pages" do
      expect(subject.page_types).to have(1).page
    end
  end

  describe "#generate" do
    it "renders a file with the file name" do
      subject = DotGrid::Generator.new({})
      expect(subject.pdf).to receive(:render_file).with(subject.file_name)
      subject.generate
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dot_grid-0.0.6 spec/lib/dot_grid/generator_spec.rb