spec/fontcustom/cli_spec.rb in fontcustom-1.3.5 vs spec/fontcustom/cli_spec.rb in fontcustom-1.3.6
- old
+ new
@@ -5,11 +5,26 @@
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