summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Wall <richard@aziz>2010-08-19 00:59:44 +0100
committerRichard Wall <richard@aziz>2010-08-19 00:59:44 +0100
commitc067ff8ae17c9db52536afc2ffbf8d32712c8494 (patch)
tree60cb6f3e6b144f1357425053f656472afec6c5bc
parentfb130e633439f43a733f5de3bd36aa4f34a89fe2 (diff)
First test
-rw-r--r--jarmon.test.js34
-rw-r--r--test.html10
2 files changed, 44 insertions, 0 deletions
diff --git a/jarmon.test.js b/jarmon.test.js
new file mode 100644
index 0000000..c4c1410
--- /dev/null
+++ b/jarmon.test.js
@@ -0,0 +1,34 @@
+/* Copyright (c) 2010 Richard Wall <richard (at) the-moon.net>
+ * See LICENSE for details.
+ *
+ * Unit tests for Jarmon
+ **/
+
+YUI().use('test', function(Y) {
+ Y.Test.Runner.add(new Y.Test.Case({
+ name: "jarmon.downloadBinary",
+
+ setUp : function () {
+ },
+
+ tearDown : function () {
+ },
+
+ test_urlNotFound: function () {
+ var d = new jarmon.downloadBinary('non-existent-file.html');
+ d.addBoth(
+ function(self, ret) {
+ console.log(ret);
+ self.resume(function() {
+ Y.Assert.isInstanceOf(Error, ret);
+ Y.Assert.areEqual(404, ret.message);
+ });
+ }, this);
+
+ this.wait();
+ },
+ }));
+
+ //run all tests
+ Y.Test.Runner.run();
+});
diff --git a/test.html b/test.html
new file mode 100644
index 0000000..9300d16
--- /dev/null
+++ b/test.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html lang="en">
+ <meta charset="utf-8">
+ <title>Jarmon Unit Test Runner</title>
+
+ <script src="http://yui.yahooapis.com/3.1.1/build/yui/yui-min.js"></script>
+ <script src="assets/js/dependencies.js"></script>
+ <script src="jarmon.js"></script>
+ <script src="jarmon.test.js"></script>
+</html>