From 4afe231bc8371560cc87f6865d74f052691ea582 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Tue, 24 Aug 2010 00:02:30 +0100 Subject: use new paths and smarten up the test results --- jarmon.test.js | 33 --------------------------------- jarmon/jarmon.test.js | 40 ++++++++++++++++++++++++++++++++++++++++ test.html | 21 +++++++++++++++------ 3 files changed, 55 insertions(+), 39 deletions(-) delete mode 100644 jarmon.test.js create mode 100644 jarmon/jarmon.test.js diff --git a/jarmon.test.js b/jarmon.test.js deleted file mode 100644 index 90cb62c..0000000 --- a/jarmon.test.js +++ /dev/null @@ -1,33 +0,0 @@ -/* 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) { - 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/jarmon/jarmon.test.js b/jarmon/jarmon.test.js new file mode 100644 index 0000000..b6ee035 --- /dev/null +++ b/jarmon/jarmon.test.js @@ -0,0 +1,40 @@ +/* Copyright (c) 2010 Richard Wall + * See LICENSE for details. + * + * Unit tests for Jarmon + **/ + +YUI({ logInclude: { TestRunner: true } }).use('console', '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) { + self.resume(function() { + Y.Assert.isInstanceOf(Error, ret); + Y.Assert.areEqual(404, ret.message); + }); + }, this); + + this.wait(); + }, + })); + + //initialize the console + var yconsole = new Y.Console({ + newestOnTop: false, + width:'600px' + }); + yconsole.render('#log'); + + //run all tests + Y.Test.Runner.run(); +}); diff --git a/test.html b/test.html index 9300d16..6db4f55 100644 --- a/test.html +++ b/test.html @@ -1,10 +1,19 @@ - - Jarmon Unit Test Runner + + + Jarmon Unit Test Runner + + - - - - + + + + + + +
+ -- cgit v1.2.3