]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#208] Implement Popcorn.error(msg);
authorRick Waldron <waldron.rick@gmail.com>
Wed, 8 Dec 2010 20:12:33 +0000 (15:12 -0500)
committerRick Waldron <waldron.rick@gmail.com>
Wed, 8 Dec 2010 20:12:33 +0000 (15:12 -0500)
popcorn.js
test/popcorn.unit.js

index b6a4587c3645347eb974644bd87839052c630496..05de7c171600d0a4e4facefdcb81468aa404943f 100644 (file)
@@ -79,6 +79,9 @@
 
   // A Few reusable utils, memoized onto Popcorn
   Popcorn.extend( Popcorn, {
+       error: function( msg ) {
+               throw msg;
+       },
     guid: function() {
       return +new Date() + Math.floor(Math.random()*11);
     }, 
index a3a85e9403ac1be78b46972a69fc1c1344582072..c565953484302fa241069ce7065f308e3761f5db 100644 (file)
@@ -39,17 +39,26 @@ test("API", function () {
 
 test("Utility", function () {
   
+  expect(6);
   //  TODO: comprehensive tests for these utilities
   
   equals( typeof Popcorn.forEach, "function" , "Popcorn.forEach is a provided utility function");
   equals( typeof Popcorn.extend, "function" , "Popcorn.extend is a provided utility function");
+  equals( typeof Popcorn.error, "function" , "Popcorn.error is a provided utility function");  
   equals( typeof Popcorn.guid, "function" , "Popcorn.guid is a provided utility function");
   equals( typeof Popcorn.sizeOf, "function" , "Popcorn.sizeOf is a provided utility function");
   equals( typeof Popcorn.nop, "function" , "Popcorn.nop is a provided utility function");
-
+  
+  
+  
+  
 });
 
 
+
+
+
+
 test("Object", function () {