prepare(new DuplicateFontFacePlugin());
DefDescriptor<StyleDef> desc1 = addStyleDef("@font-face {font-family: Custom1; src: url(Custom1.woff)}");
DefDescriptor<StyleDef> desc2 = addStyleDef("@font-face {font-family: Custom2; src: url(Custom2.woff)}");
DefDescriptor<StyleDef> desc3 = addStyleDef("@font-face {font-family: Custom1; src: url(Custom1.woff)}");
StyleDefCSSFormatAdapter cssFormatAdapter = new StyleDefCSSFormatAdapter();
try {
cssFormatAdapter.writeCollection(Lists.newArrayList(desc1.getDef(), desc2.getDef(), desc3.getDef()), out);
fail("expected to get exception");
} catch (Exception e) {
checkExceptionContains(e, AuraRuntimeException.class, "was already declared");
}
}