mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
6cbc2bf9b3
Also, created tests for the propper "flattening" of whitespace-active-areas and created most of the code. However, it is to be noted in this release... TESTS ARE BROKEN. The flattening needs some love still. And the testing needs to get expanded further. I thought this would be easy, turns out its a bit of a bitch. git-svn-id: svn://hamptoncatlin.com/haml/trunk@16 7063305b-7217-0410-af8c-cdc13e5119b9
26 lines
1.3 KiB
Ruby
26 lines
1.3 KiB
Ruby
require 'test/unit'
|
|
require File.dirname(__FILE__) + '/../lib/haml/engine'
|
|
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
|
require 'rubygems'
|
|
require 'action_view'
|
|
|
|
class HamlTest < Test::Unit::TestCase
|
|
include HAMLHelpers
|
|
|
|
def test_tupleize
|
|
assert_equal(tupleize([1,2,3], [4,5,6]), [[1,4],[2,5],[3,6]])
|
|
end
|
|
|
|
def test_find_and_flatten
|
|
assert_equal(find_and_flatten("<br/><textarea></textarea><br/>"),
|
|
"<br/><textarea></textarea><br/>")
|
|
assert_equal(find_and_flatten("<code lang='ruby'>TEST!</code>\t\t<p></p>"),
|
|
"<code lang='ruby'>TEST!</code>\t\t<p></p>")
|
|
assert_equal(find_and_flatten("<pre>Hello\nWorld!\nYOU ARE \rFLAT?\n\rOMGZ!</pre></br>"),
|
|
"<pre>Hello
World!
YOU ARE FLAT?
OMGZ!</pre></br>")
|
|
assert_equal( "<div class='text_area_test_area'>\n <textarea>Two
 lines</textarea>\n</div>\n",
|
|
find_and_flatten("<div class='text_area_test_area'>\n <textarea>Two\n lines</textarea>\n</div>\n"))
|
|
assert_equal( "<code>Two
lines</code><pre>a
b
c</pre>",
|
|
find_and_flatten("<code>Two\nlines</code><pre>a\nb\nc</pre>"))
|
|
end
|
|
end
|