require 'test_helper' class FlannelTest < Test::Unit::TestCase should "wrap functionality up in a neat package" do markup = ":header_two foo Foo\n\n:list list Bar" assert_equal "
This is paragraph one.
\n\nThis is paragraph two.
\n\nThis is paragraph three. Watchout for the end of file.
" assert_equal output, Flannel.quilt(input) end context "basic behavior" do should "strip and convert underscores to pre tags" do markup = ":preformatted foo\nfoo\n\n bar\n" assert_equal "foo\n\n bar\n", Flannel.quilt(markup) end should "escape preformatted text" do markup = ":preformatted math\n4 - 2 > 2 - 2\n" assert_equal "
4 - 2 > 2 - 2\n", Flannel.quilt(markup) end end context "When block starts with header, it" do should "convert one to a header one" do markup = ":header_one h\n Some header" result = "