Improve error reporting. New error page that gives a bit more of an explanation...
[frank.git] / test / net / jaekl / frank / StyleTest.java
diff --git a/test/net/jaekl/frank/StyleTest.java b/test/net/jaekl/frank/StyleTest.java
new file mode 100644 (file)
index 0000000..f08f649
--- /dev/null
@@ -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);
+       }
+}