diff options
author | Richard Wall <richard@aziz> | 2010-08-24 00:02:30 +0100 |
---|---|---|
committer | Richard Wall <richard@aziz> | 2010-08-24 00:02:30 +0100 |
commit | 4afe231bc8371560cc87f6865d74f052691ea582 (patch) | |
tree | 28832025966ae332dd7e01154119c5b5aa04b26e /jarmon/jarmon.test.js | |
parent | 7a17a59d7178ee5ab68b1f6313ad301ed2c8a9e3 (diff) |
use new paths and smarten up the test results
Diffstat (limited to 'jarmon/jarmon.test.js')
-rw-r--r-- | jarmon/jarmon.test.js | 40 |
1 files changed, 40 insertions, 0 deletions
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 <richard (at) the-moon.net> + * 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(); +}); |