RubySassEngine { public String process(final String content) { if (isEmpty(content)) { return StringUtils.EMPTY; } try { synchronized(this) { return engineInitializer.get().eval(buildUpdateScript(content)).toString(); } } catch (final ScriptException e) { throw new WroRuntimeException(e.getMessage(), e); } } RubySassEngine(); void addRequire(final String require); String process(final String content);  }
@Test public void shouldReturnEmptyStringWhenNullContentIsProcessed() { assertEquals(StringUtils.EMPTY, engine.process(null)); }
@Test public void shouldReturnEmptyStringWhenEmptyContentIsProcessed() { assertEquals(StringUtils.EMPTY, engine.process("")); }
@Test(expected = WroRuntimeException.class) public void cannotProcessInvalidCss() { assertEquals(StringUtils.EMPTY, engine.process("invalidCss")); }
@Test public void shouldProcessValidCss() throws IOException { assertEquals("#element {\n color: red; }\n", engine.process("#element {color: red;}")); }
@Test public void shouldProcessValidSass() throws IOException { assertEquals("#element #child {\n color: red; }\n", engine.process("#element { #child {color: red;}}")); }
@Test public void shouldProcessValidNonAsciiSass() throws IOException { assertEquals("@charset \"UTF-8\";\n#element {\n font-family: \"\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF\"; }\n", engine.process("#element {font-family: \"\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF\";}")); }