require File.dirname(__FILE__) + '/helper' class TestRedCloth < Test::Unit::TestCase context "RedCloth default (no explicit config) hard_breaks enabled" do setup do @textile = TextileConverter.new end should "preserve single line breaks in HTML output" do assert_equal "
line1
\nline2
line1
\nline2
line1
\nline2
line1\nline2
", @textile.convert("p. line1\nline2").strip end end context "RedCloth w/no_span_caps set to false" do setup do config = { 'redcloth' => { 'no_span_caps' => false } } @textile = TextileConverter.new config end should "generate span tags around capitalized words" do assert_equal "NSC
", @textile.convert("NSC").strip end end context "RedCloth w/no_span_caps set to true" do setup do config = { 'redcloth' => { 'no_span_caps' => true } } @textile = TextileConverter.new config end should "not generate span tags around capitalized words" do assert_equal "NSC
", @textile.convert("NSC").strip end end end