Sha256: 82ddd109915472abe36ce34e71b2d580e83c63371619801eca68c06ffbc2f158

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

# encoding: UTF-8
require 'spec_helper'

describe Grim do
  it "should have a default processor" do
    expect(Grim.processor.class).to eq(Grim::ImageMagickProcessor)
  end

  it "should have a VERSION constant" do
    expect(Grim.const_defined?('VERSION')).to be(true)
  end

  it "should have WIDTH constant set to 1024" do
    expect(Grim::WIDTH).to eq(1024)
  end

  it "should have QUALITY constant set to 90" do
    expect(Grim::QUALITY).to eq(90)
  end

  it "should have DENSITY constant set to 300" do
    expect(Grim::DENSITY).to eq(300)
  end

  it "should have COLORSPACE constant set to 'RGB'" do
    expect(Grim::COLORSPACE).to eq('RGB')
  end

  describe ".reap" do
    it "should return an instance of Grim::Pdf" do
      expect(Grim.reap(fixture_path("smoker.pdf")).class).to eq(Grim::Pdf)
    end
  end

  describe ".logger=" do
    it "sets Grim.logger" do
      original_logger = Grim.logger
      begin
        Grim.logger = "foo"
        expect(Grim.logger).to eq("foo")
      ensure
        Grim.logger = original_logger
      end
    end
  end

  describe ".logger" do
    it "returns a Grim::NullLogger by default" do
      expect(Grim.logger).to be_instance_of(Grim::NullLogger)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
grim-1.3.5 spec/lib/grim_spec.rb
grim-1.3.4 spec/lib/grim_spec.rb
grim-1.3.3 spec/lib/grim_spec.rb
grim-1.3.2 spec/lib/grim_spec.rb
grim-1.3.1 spec/lib/grim_spec.rb
grim-1.3.0 spec/lib/grim_spec.rb