add tests for rendering .litcoffee as markdown
Coby Chapple coby@cobychapple.com
Fri, 05 Apr 2013 13:24:00 +0100
3 files changed,
117 insertions(+),
0 deletions(-)
M
test/markup_test.rb
→
test/markup_test.rb
@@ -36,6 +36,7 @@ def test_knows_what_it_can_and_cannot_render
assert_equal false, GitHub::Markup.can_render?('README.html') assert_equal true, GitHub::Markup.can_render?('README.markdown') assert_equal false, GitHub::Markup.can_render?('README.cmd') + assert_equal true, GitHub::Markup.can_render?('README.litcoffee') end def test_fails_gracefully_on_missing_commands
A
test/markups/README.litcoffee
@@ -0,0 +1,59 @@
+Literate CoffeeScript Test +-------------------------- + +> Taken from https://github.com/jashkenas/coffee-script/blob/master/test/literate.litcoffee + +comment comment + + test "basic literate CoffeeScript parsing", -> + ok yes + +now with a... + + test "broken up indentation", -> + +... broken up ... + + do -> + +... nested block. + + ok yes + +Code must be separated from text by a blank line. + + test "code blocks must be preceded by a blank line", -> + +The next line is part of the text and will not be executed. + fail() + + ok yes + +Code in `backticks is not parsed` and... + + test "comments in indented blocks work", -> + do -> + do -> + # Regular comment. + + ### + Block comment. + ### + + ok yes + +Regular [Markdown](http://example.com/markdown) features, like links +and unordered lists, are fine: + + * I + + * Am + + * A + + * List + +Tabs work too: + + test "tabbed code", -> + ok yes
A
test/markups/README.litcoffee.html
@@ -0,0 +1,57 @@
+<h2 id='literate_coffeescript_test'>Literate CoffeeScript Test</h2> + +<blockquote> +<p>Taken from https://github.com/jashkenas/coffee-script/blob/master/test/literate.litcoffee</p> +</blockquote> + +<p>comment comment</p> + +<pre><code>test "basic literate CoffeeScript parsing", -> + ok yes</code></pre> + +<p>now with a…</p> + +<pre><code>test "broken up indentation", -></code></pre> + +<p>… broken up …</p> + +<pre><code> do -></code></pre> + +<p>… nested block.</p> + +<pre><code> ok yes</code></pre> + +<p>Code must be separated from text by a blank line.</p> + +<pre><code>test "code blocks must be preceded by a blank line", -></code></pre> + +<p>The next line is part of the text and will not be executed. fail()</p> + +<pre><code> ok yes</code></pre> + +<p>Code in <code>backticks is not parsed</code> and…</p> + +<pre><code>test "comments in indented blocks work", -> + do -> + do -> + # Regular comment. + + ### + Block comment. + ### + + ok yes</code></pre> + +<p>Regular <a href='http://example.com/markdown'>Markdown</a> features, like links and unordered lists, are fine:</p> + +<p>* I</p> + +<p>* Am</p> + +<p>* A</p> + +<p>* List</p> + +<p>Tabs work too:</p> + +<p>test “tabbed code”, -> ok yes</p>