Skip to content

Commit

Permalink
[mozilla#208] Implement Popcorn.error(msg);
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Dec 8, 2010
1 parent 5c4c6e8 commit bd35aac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions popcorn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand Down
11 changes: 10 additions & 1 deletion test/popcorn.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {


Expand Down

0 comments on commit bd35aac

Please sign in to comment.