require 'helper' describe Temple::HTML::Pretty do before do @html = Temple::HTML::Pretty.new end it 'should indent nested tags' do @html.call([:html, :tag, 'div', [:multi], false, [:html, :tag, 'p', [:multi], false, [:multi, [:static, 'text'], [:dynamic, 'code']]] ]).should.equal [:multi, [:block, "_temple_pre_tags = /
"], [:multi, [:static, "\n"], [:multi, [:static, "text"], [:dynamic, 'Temple::Utils.indent((code), "\n ", _temple_pre_tags)']], [:static, "
"]], [:static, "\n"]]] end it 'should not indent preformatted tags' do @html.call([:html, :tag, 'pre', [:multi], false, [:html, :tag, 'p', [:multi], false, [:static, 'text']] ]).should.equal [:multi, [:block, "_temple_pre_tags = /"], [:multi, [:static, ""]]] end end"], [:static, "text"], [:static, "
"]], [:static, "