Permalink
Browse files

Update tests

  • Loading branch information...
1 parent bbc480b commit 54149835d6b37db7bd4a09ffb522ee41bbd6d50f @pvorb committed Feb 15, 2012
Showing with 33 additions and 13 deletions.
  1. +4 −1 test/bake.js
  2. +19 −0 test/pub/test.html
  3. +1 −2 test/pub/test.mkd
  4. +9 −10 test/templates/post.tpl
View
5 test/bake.js
@@ -6,9 +6,12 @@ var bake = require('../bake.js');
var a = {};
// Read the configuration file
-var conf = fs.readFileSync(path.resolve(process.cwd(), 'conf/bake.json'),
+var conf = fs.readFileSync(path.resolve(__dirname, 'conf/bake.json'),
'utf8');
+conf = JSON.parse(conf);
+conf.root = __dirname;
+
var hooks = {
__content: function(fn, properties, callback) {
return pandoc(properties.__content, 'markdown', 'html', callback);
View
19 test/pub/test.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>First post » My Site</title>
+ </head>
+ <body>
+ <h1>First post</h1>
+ <p>Written on August 14th, 2011 by Paul</p>
+
+<p>This is my <strong>first</strong> blog post.</p>
+<h1 id="heres-a-heading">Here's a heading</h1>
+<blockquote>
+<p>And this is a block quote</p>
+</blockquote>
+
+ </body>
+</html>
+
View
3 test/pub/test.mkd
@@ -6,7 +6,6 @@ template: post.tpl
This is my **first** blog post.
-Here's a heading
-----------------
+# Here's a heading
> And this is a block quote
View
19 test/templates/post.tpl
@@ -1,15 +1,14 @@
<!DOCTYPE html>
<html lang="en">
- <head>
- <meta charset="utf-8">
- <title><%= title %> » <%= siteTitle %></title>
- </head>
- <body>
- <h1><%= title %></h1>
- <p>Written on <%= date %> by <%= author %></p>
-<% if (has('foo')) { %>Something went wrong<% } %>
+ <head>
+ <meta charset="utf-8">
+ <title><%= title %> » <%= siteTitle %></title>
+ </head>
+ <body>
+ <h1><%= title %></h1>
+ <p>Written on <%= date %> by <%= author %></p>
+<% if (locals.foo) { %>Something went wrong<% } %>
<%= __content %>
-
- </body>
+ </body>
</html>

0 comments on commit 5414983

Please sign in to comment.