Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / src / core / test / unit / spec / lang / Error.js
index 47578a3..bc5100b 100644 (file)
@@ -1,6 +1,19 @@
+/*
+
+This file is part of Ext JS 4
+
+Copyright (c) 2011 Sencha Inc
+
+Contact:  http://www.sencha.com/contact
+
+GNU General Public License Usage
+This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.  Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+
+If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
+
+*/
 describe("Ext.Error", function() { 
-    var global,
-        consoleWarningMsg = 'An uncaught error was raised with the following data:';
+    var global;
 
     beforeEach(function() {
         global = Ext.global;
@@ -11,6 +24,9 @@ describe("Ext.Error", function() {
                 dir: function(s) {
                     return s;
                 },
+                error: function(s) {
+                    return s;
+                },
                 warn: function(s) {
                     return s;
                 }
@@ -35,13 +51,13 @@ describe("Ext.Error", function() {
                 }
             });
         
-            it("should log a warning to the console", function() {
-                spyOn(Ext.global.console, 'warn');
+            it("should log an error to the console", function() {
+                spyOn(Ext.global.console, 'error');
                 try {
                     Ext.Error.raise('foo');
                 } 
                 catch (err) {}
-                expect(Ext.global.console.warn).toHaveBeenCalledWith(consoleWarningMsg);
+                expect(Ext.global.console.error).toHaveBeenCalledWith('[E] foo');
             });
         
             it("should log the error object to the console", function() {
@@ -98,13 +114,13 @@ describe("Ext.Error", function() {
                 }
             });
         
-            it("should log a warning to the console", function() {
-                spyOn(Ext.global.console, 'warn');
+            it("should log an error to the console", function() {
+                spyOn(Ext.global.console, 'error');
                 try {
                     Ext.Error.raise({msg: 'foo'});
                 } 
                 catch (err) {}
-                expect(Ext.global.console.warn).toHaveBeenCalledWith(consoleWarningMsg);
+                expect(Ext.global.console.error).toHaveBeenCalledWith('[E] foo');
             });
         
             it("should log the error object to the console", function() {
@@ -232,3 +248,4 @@ describe("Ext.Error", function() {
         });
     });
 });
+