Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update the unit tests to reflect the html formatting.

  • Loading branch information...
commit f5181413cc5ffcfed7818ee874a116b27027af06 1 parent b8e595c
@creationix authored
View
5 test/div_nesting.html
@@ -1,3 +1,4 @@
<div>Does not close properly
-<div>Nested same level as next div</div></div>
-<div>Will be nested, but should be top level</div>
+<div>Nested same level as next div
+</div></div><div>Will be nested, but should be top level
+</div>
View
18 test/foreach.haml
@@ -1,9 +1,9 @@
-= myarray
-= mystring
-:foreach{array: myarray, value: 'item'}
- = item
- = mystring
-%ul#results
- :foreach{array: data, value:'item'}
- :foreach{array : item, key: 'key', value : 'i'}
- = key + ':' + i
+:each color in colors
+ .preview{style: "color: " + color + ";"}&= name
+:each item in data
+ :if item.age < 100
+ %dl
+ :each name, value in item
+ %dt&= name
+ %dd&= value
+
View
8 test/foreach.html
@@ -0,0 +1,8 @@
+<div style="color: #f80;" class="preview">My Rainbow
+</div><div style="color: #08f;" class="preview">My Rainbow
+</div><div style="color: #4f4;" class="preview">My Rainbow
+</div><dl><dt>name
+</dt><dd>Tim Caswell
+</dd><dt>age
+</dt><dd>27
+</dd></dl>
View
9 test/foreach.js
@@ -1,7 +1,10 @@
{
locals: {
- myarray : [1,2,3],
- mystring : "hello there",
- data: [{name: "object1", value:"value1"}, {name: "object2", value:"value2"}]
+ colors: ["#f80", "#08f", "#4f4"],
+ name: "My Rainbow",
+ data: [
+ {name: "Tim Caswell", age: 27},
+ {name: "John Smith", age: 107},
+ ]
}
}
View
11 test/non-string-attribs.html
@@ -1,8 +1,3 @@
-<div id="plain">Plain Text</div>
-<div id="escaped">&lt;escaped&gt;</div>
-<input checked="checked" />
-<input />
-<input />
-<input />
-<input checked="0" />
-<input />
+<div id="plain">Plain Text
+</div><div id="escaped">&lt;escaped&gt;
+</div><input checked="checked" /><input /><input /><input /><input checked="0" /><input />
View
11 test/standard.html
@@ -1,7 +1,8 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Sample haml template</title></head>
-<body><div class="profile"><div class="left column"><div id="date">January 1, 2009</div>
-<div id="address">Richardson, TX</div></div>
-<div class="right column"><div id="email">tim@creationix.com</div>
-<div id="bio">Experienced software professional...</div></div></div></body></html>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Sample haml template
+</title></head><body><div class="profile"><div class="left column"><div id="date">January 1, 2009
+</div><div id="address">Richardson, TX
+</div></div><div class="right column"><div id="email">tim@creationix.com
+</div><div id="bio">Experienced software professional...
+</div></div></div></body></html>
View
4 test/test.js
@@ -18,10 +18,10 @@ posix.readdir('.').addCallback(function (files) {
file.read(haml_file).addCallback(function (haml) {
file.read(base + ".html").addCallback(function (expected) {
var actual = Haml.render(haml, scope);
- if (actual !== expected) {
+ // if (actual !== expected) {
puts("Actual:\n" + actual);
puts("Expected:\n" + expected);
- }
+ // }
assert.equal(actual, expected);
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.