Reorganize things and remove unneeded dependency on jQuery

This commit is contained in:
wycats
2010-07-31 12:00:11 -07:00
parent a83e87e5ae
commit 755f854c50
7 changed files with 22 additions and 26 deletions
-21
View File
@@ -1,21 +0,0 @@
jQuery(function($) {
module("basic context");
test("compiling with a basic context", function() {
var string = "Goodbye\n{{cruel}}\n{{world}}";
var template = Handlebars.compile(string);
result = template({cruel: "cruel", world: "world"});
equal("Goodbye\ncruel\nworld", result, "it works if all the required keys are provided");
});
test("comments", function() {
var string = "{{! Goodbye}}Goodbye\n{{cruel}}\n{{world}}";
var template = Handlebars.compile(string);
result = template({cruel: "cruel", world: "world"});
equal("Goodbye\ncruel\nworld", result, "it works if all the required keys are provided");
});
});
+17
View File
@@ -0,0 +1,17 @@
module("basic context");
test("compiling with a basic context", function() {
var string = "Goodbye\n{{cruel}}\n{{world}}";
var template = Handlebars.compile(string);
result = template({cruel: "cruel", world: "world"});
equal("Goodbye\ncruel\nworld", result, "it works if all the required keys are provided");
});
test("comments", function() {
var string = "{{! Goodbye}}Goodbye\n{{cruel}}\n{{world}}";
var template = Handlebars.compile(string);
result = template({cruel: "cruel", world: "world"});
equal("Goodbye\ncruel\nworld", result, "it works if all the required keys are provided");
});
+5 -5
View File
@@ -2,11 +2,10 @@
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="../vendor/jquery.js"></script>
<link rel="stylesheet" href="../vendor/test/qunit.css" type="text/css" media="screen" />
<script type="text/javascript" src="../vendor/test/qunit.js"></script>
<script type="text/javascript" src="../handlebars.js"></script>
<script type="text/javascript" src="handlebars.js"></script>
<script src="vendor/jquery.js"></script>
<link rel="stylesheet" href="vendor/test/qunit.css" type="text/css" media="screen" />
<script type="text/javascript" src="vendor/test/qunit.js"></script>
<script type="text/javascript" src="../lib/handlebars.js"></script>
</head>
<body>
<h1 id="qunit-header">QUnit example</h1>
@@ -15,6 +14,7 @@
<ol id="qunit-tests"></ol>
<div id="main" style="display: none">
</div>
<script type="text/javascript" src="handlebars.js"></script>
</body>
</html>
View File