X-Git-Url: http://jaekl.net/gitweb/?p=frank.git;a=blobdiff_plain;f=test%2Fnet%2Fjaekl%2Ffrank%2FStyleTest.java;fp=test%2Fnet%2Fjaekl%2Ffrank%2FStyleTest.java;h=f08f649400a297ac4ab8d85d593b4004f362023c;hp=0000000000000000000000000000000000000000;hb=60dc53edca9ae2bcd6703e02b26acd47ef3d61a8;hpb=418e4d229a8b607b022cfb867bb702bec1765d13 diff --git a/test/net/jaekl/frank/StyleTest.java b/test/net/jaekl/frank/StyleTest.java new file mode 100644 index 0000000..f08f649 --- /dev/null +++ b/test/net/jaekl/frank/StyleTest.java @@ -0,0 +1,45 @@ +package net.jaekl.frank; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintWriter; + +import junit.framework.Assert; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class StyleTest { + ByteArrayOutputStream m_baos; + PrintWriter m_pw; + + @Before + public void setUp() { + m_baos = new ByteArrayOutputStream(); + m_pw = new PrintWriter(m_baos); + } + + @After + public void tearDown() throws IOException { + if (null != m_baos) { + m_baos.close(); + } + } + + // Should develop something here that is a bit smarter about what + // it's looking for, and less brittle than a simple compare-against-master... + @Test + public void test_writeStyle() { + String actual; + + m_baos.reset(); + + Style style = new Style(); + style.writeStyle(m_pw); + m_pw.flush(); + + actual = m_baos.toString(); + Assert.assertEquals(Style.CSS + "\n", actual); + } +}