Sha256: 1b453694ab3d3a0d6b056ba69b093e157d360031c11a1b8af0920daecf5ca958

Contents?: true

Size: 731 Bytes

Versions: 1

Compression:

Stored size: 731 Bytes

Contents

require 'spec_helper'

describe "DotGrid::Page::DotGrid" do
  describe "#initialize" do
    let(:pdf) { double('pdf', bounds: double('bounds')) }

    it "creates a dot grid pattern" do
      expect(::DotGrid::Pattern::DotGrid).to receive(:new)
      DotGrid::Page::DotGrid.new({pdf: pdf})
    end
  end

  describe "#generate" do
    let(:pdf) { double('pdf', bounds: double('bounds')) }
    let(:subject) { DotGrid::Page::DotGrid.new({pdf: pdf})}
    let(:pattern) { double('pattern') }

    before do
      allow(pdf).to receive(:start_new_page)
      allow(subject).to receive(:pattern).and_return(pattern)
    end

    it "draws the pattern" do
      expect(pattern).to receive(:draw)
      subject.generate
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dot_grid-0.0.4 spec/lib/dot_grid/page/dot_grid_spec.rb