# encoding: UTF-8 require 'simplecov' require 'simplecov-rcov' SimpleCov.start SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter require 'test_helper' class GovspeakTest < Test::Unit::TestCase test "simple smoke-test" do rendered = Govspeak::Document.new("*this is markdown*").to_html assert_equal "
this is markdown
\n", rendered end test "simple smoke-test for simplified API" do rendered = Govspeak::Document.to_html("*this is markdown*") assert_equal "this is markdown
\n", rendered end test "simple block extension" do rendered = Govspeak::Document.new("this \n{::reverse}\n*is*\n{:/reverse}\n markdown").to_html assert_equal "this
\n\nsi
\n\nmarkdown
\n", rendered end test "highlight-answer block extension" do rendered = Govspeak::Document.new("this \n{::highlight-answer}Lead in to *BIG TEXT*\n{:/highlight-answer}").to_html assert_equal %Q{this
\n\nLead in to BIG TEXT
\n\n123 Test Street
Testcase Cliffs
Teston
0123 456 7890 \n
I am very informational
The following is very informational
I am very informational
I am very informational
I am very important
The following is very important
I am very important
I am very helpful
The following is very helpful
I am very helpful
I am very helpful
I am very helpful
This is a link isn’t it?
', text: "This is a link isn’t it?" }, { input: "This is a [link with an at sign in it](http://www.google.com/@dg/@this) isn't it?", output: 'This is a link with an at sign in it isn’t it?
', text: "This is a link with an at sign in it isn’t it?" }, { input: "HTML *[HTML]: Hyper Text Markup Language", output: %{HTML
}, text: "HTML" }, { input: "x[a link](http://rubyforge.org)x", output: '', text: "a link" }, { input: "$! rainbow $!", output: %{rainbow
help, send cake
street
road
help
\ncan you tell me how to get to…
zippy
\nbungle
\ngeorge
\nThis section applies to Scotland
I am very devolved and very scottish
Message with a link