Sha256: 101e070168d1cc34d2331508dd9ea9da24bdf962364bdb1557dc03217fcbdf0c

Contents?: true

Size: 1.35 KB

Versions: 6

Compression:

Stored size: 1.35 KB

Contents

require "spec_helper"
require "fontcustom/cli"

describe Fontcustom::CLI do
  context "#compile" do
    it "should generate fonts and templates (integration)", :integration => true do
      live_test do |testdir|
        Fontcustom::CLI.start ["compile", "vectors", "--quiet"]
        manifest = File.join testdir, ".fontcustom-manifest.json"
        preview = File.join testdir, "fontcustom", "fontcustom-preview.html"

        expect(Dir.glob(File.join(testdir, "fontcustom", "fontcustom_*\.{ttf,svg,woff,eot}")).length).to eq(4)
        expect(File.read(manifest)).to match(/"fonts":.+fontcustom\/fontcustom_.+\.ttf"/m)
        expect(File.exists?(preview)).to be_truthy
      end
    end

    it "should generate fonts and templates according to passed options (integration)", :integration => true do
      live_test do |testdir|
        Fontcustom::CLI.start ["compile", "vectors", "--font-name", "example", "--preprocessor-path", "../foo/bar", "--templates", "css", "scss-rails", "preview", "--no-hash", "--base64", "--quiet"]
        manifest = File.join testdir, ".fontcustom-manifest.json"
        css = Dir.glob(File.join("example", "*.scss")).first

        expect(File.read(manifest)).to match(/"fonts":.+example\/example\.ttf"/m)
        expect(File.read(css)).to match("x-font-woff")
        expect(File.read(css)).to match("../foo/bar/")
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
fontcustom-2.0.0 spec/fontcustom/cli_spec.rb
gkh-fontcustom-1.3.8 spec/fontcustom/cli_spec.rb
gkh-fontcustom-1.3.7 spec/fontcustom/cli_spec.rb
fontcustom-1.3.8 spec/fontcustom/cli_spec.rb
fontcustom-1.3.7 spec/fontcustom/cli_spec.rb
fontcustom-1.3.6 spec/fontcustom/cli_spec.rb