From c067ff8ae17c9db52536afc2ffbf8d32712c8494 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Thu, 19 Aug 2010 00:59:44 +0100 Subject: First test --- jarmon.test.js | 34 ++++++++++++++++++++++++++++++++++ test.html | 10 ++++++++++ 2 files changed, 44 insertions(+) create mode 100644 jarmon.test.js create mode 100644 test.html 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 + * 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 @@ + + + + Jarmon Unit Test Runner + + + + + + -- cgit v1.2.3-2-g168b