Sha256: 2dd47e7d1a26959d12835a7e12d2bc715532536525b66c5b85727fcf93e9eac2

Contents?: true

Size: 747 Bytes

Versions: 1

Compression:

Stored size: 747 Bytes

Contents

require "spec_helper"

RSpec.describe Fontist::MsVistaFont do
  describe ".fetch_font" do
    context "with valid licence", api_call: true do
      it "downloads and returns font paths" do
        name = "CANDARAI.TTF"
        fonts = Fontist::MsVistaFont.fetch_font(
          name, confirmation: "yes", force_download: true
        )

        expect(fonts.count).to eq(1)
        expect(fonts.first).to include("CANDARAI.TTF")
      end
    end

    context "with invalid licence agreement" do
      it "raise an licensing error" do
        font_name = "CANDARAI.TTF"

        expect {
          Fontist::MsVistaFont.fetch_font(font_name, confirmation: "no")
        }.to raise_error(Fontist::Errors::LicensingError)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fontist-0.2.0 spec/fontist/ms_vista_font_spec.rb