cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [1/3] git commit: CB-6337 Print nice error when cordova-cli hits various expected things
Date Thu, 27 Mar 2014 21:49:36 GMT
Repository: cordova-cli
Updated Branches:
  refs/heads/master 4da7f4e37 -> 22b14f4e7


CB-6337 Print nice error when cordova-cli hits various expected things

Add missing CordovaError requires
Reduce specificity of jasmine toThrow() expectations


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/4f4dc29a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/4f4dc29a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/4f4dc29a

Branch: refs/heads/master
Commit: 4f4dc29af98d8080507c0d6fe0015cec780fd701
Parents: 55c278c
Author: Josh Soref <jsoref@blackberry.com>
Authored: Wed Mar 26 11:57:27 2014 -0400
Committer: Josh Soref <jsoref@blackberry.com>
Committed: Wed Mar 26 11:57:52 2014 -0400

----------------------------------------------------------------------
 e2e/hooker.spec.js                      | 2 +-
 spec/metadata/android_parser.spec.js    | 2 +-
 spec/metadata/blackberry_parser.spec.js | 2 +-
 spec/metadata/ios_parser.spec.js        | 2 +-
 spec/metadata/windows8_parser.spec.js   | 2 +-
 spec/metadata/wp7_parser.spec.js        | 3 ++-
 spec/metadata/wp8_parser.spec.js        | 3 ++-
 src/metadata/amazon_fireos_parser.js    | 3 ++-
 src/metadata/android_parser.js          | 3 ++-
 src/metadata/blackberry10_parser.js     | 3 ++-
 src/metadata/ios_parser.js              | 3 ++-
 src/metadata/ubuntu_parser.js           | 5 +++--
 src/metadata/windows8_parser.js         | 3 ++-
 src/metadata/wp7_parser.js              | 3 ++-
 src/metadata/wp8_parser.js              | 3 ++-
 15 files changed, 26 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/e2e/hooker.spec.js
----------------------------------------------------------------------
diff --git a/e2e/hooker.spec.js b/e2e/hooker.spec.js
index 4aa41bf..c85cc59 100644
--- a/e2e/hooker.spec.js
+++ b/e2e/hooker.spec.js
@@ -50,7 +50,7 @@ describe('hooker', function() {
     it('should throw if provided directory is not a cordova project', function() {
         expect(function() {
             new hooker(tmpDir);
-        }).toThrow('Not a Cordova project, can\'t use hooks.');
+        }).toThrow();
     });
 });
 

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/spec/metadata/android_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/android_parser.spec.js b/spec/metadata/android_parser.spec.js
index 47c48a6..2459704 100644
--- a/spec/metadata/android_parser.spec.js
+++ b/spec/metadata/android_parser.spec.js
@@ -68,7 +68,7 @@ describe('android project parser', function() {
             exists.andReturn(false);
             expect(function() {
                 new platforms.android.parser(proj);
-            }).toThrow('The provided path "' + proj + '" is not an Android project.');
+            }).toThrow();
         });
         it('should create an instance with path, strings, manifest and android_config properties',
function() {
             expect(function() {

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/spec/metadata/blackberry_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/blackberry_parser.spec.js b/spec/metadata/blackberry_parser.spec.js
index 0a571e7..b1d0b47 100644
--- a/spec/metadata/blackberry_parser.spec.js
+++ b/spec/metadata/blackberry_parser.spec.js
@@ -82,7 +82,7 @@ describe('blackberry10 project parser', function() {
             exists.andReturn(false);
             expect(function() {
                 new platforms.blackberry10.parser(proj);
-            }).toThrow('The provided path "/some/path" is not a Cordova BlackBerry10 project.');
+            }).toThrow();
         });
         it('should accept a proper native blackberry project path as construction parameter',
function() {
             var project;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/spec/metadata/ios_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/ios_parser.spec.js b/spec/metadata/ios_parser.spec.js
index 79f6c9f..5b2977e 100644
--- a/spec/metadata/ios_parser.spec.js
+++ b/spec/metadata/ios_parser.spec.js
@@ -57,7 +57,7 @@ describe('ios project parser', function () {
             readdir.andReturn(['noxcodehere']);
             expect(function() {
                 new platforms.ios.parser(proj);
-            }).toThrow('The provided path is not a Cordova iOS project.');
+            }).toThrow();
         });
         it('should create an instance with path, pbxproj, xcodeproj, originalName and cordovaproj
properties', function() {
             expect(function() {

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/spec/metadata/windows8_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/windows8_parser.spec.js b/spec/metadata/windows8_parser.spec.js
index d59e60a..726391f 100644
--- a/spec/metadata/windows8_parser.spec.js
+++ b/spec/metadata/windows8_parser.spec.js
@@ -69,7 +69,7 @@ describe('windows8 project parser', function() {
             readdir.andReturn([]);
             expect(function() {
                 new platforms.windows8.parser(proj);
-            }).toThrow('The provided path "' + proj + '" is not a Windows 8 project. Error:
No .jsproj file.');
+            }).toThrow();
         });
         it('should create an instance with path, manifest properties', function() {
             expect(function() {

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/spec/metadata/wp7_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/wp7_parser.spec.js b/spec/metadata/wp7_parser.spec.js
index 5313b80..0856391 100644
--- a/spec/metadata/wp7_parser.spec.js
+++ b/spec/metadata/wp7_parser.spec.js
@@ -28,6 +28,7 @@ var platforms = require('../../platforms'),
     child_process = require('child_process'),
     config = require('../../src/config'),
     ConfigParser = require('../../src/ConfigParser'),
+    CordovaError = require('../../src/CordovaError'),
     cordova = require('../../cordova');
 
 // Create a real config object before mocking out everything.
@@ -75,7 +76,7 @@ describe('wp7 project parser', function() {
             readdir.andReturn([]);
             expect(function() {
                 new platforms.wp7.parser(proj);
-            }).toThrow('The provided path "' + proj + '" is not a Windows Phone 7 project.
Error: No .csproj file.');
+            }).toThrow();
         });
         it('should create an instance with path, manifest properties', function() {
             expect(function() {

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/spec/metadata/wp8_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/wp8_parser.spec.js b/spec/metadata/wp8_parser.spec.js
index 0ad8dc2..5ea461e 100644
--- a/spec/metadata/wp8_parser.spec.js
+++ b/spec/metadata/wp8_parser.spec.js
@@ -28,6 +28,7 @@ var platforms = require('../../platforms'),
     child_process = require('child_process'),
     config = require('../../src/config'),
     ConfigParser = require('../../src/ConfigParser'),
+    CordovaError = require('../../src/CordovaError'),
     cordova = require('../../cordova');
 
 // Create a real config object before mocking out everything.
@@ -75,7 +76,7 @@ describe('wp8 project parser', function() {
             readdir.andReturn([]);
             expect(function() {
                 new platforms.wp8.parser(proj);
-            }).toThrow('The provided path "' + proj + '" is not a Windows Phone 8 project.
Error: No .csproj file.');
+            }).toThrow();
         });
         it('should create an instance with path, manifest properties', function() {
             expect(function() {

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/src/metadata/amazon_fireos_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/amazon_fireos_parser.js b/src/metadata/amazon_fireos_parser.js
index b2902bb..4b727cb 100644
--- a/src/metadata/amazon_fireos_parser.js
+++ b/src/metadata/amazon_fireos_parser.js
@@ -24,7 +24,8 @@ var fs            = require('fs'),
     shell         = require('shelljs'),
     project_config= require('../config'),
     Q             = require('q'),
-    ConfigParser = require('../ConfigParser');
+    ConfigParser = require('../ConfigParser'),
+    CordovaError = require('../CordovaError');
 
 var awv_interface='awv_interface.jar';
 

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/src/metadata/android_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/android_parser.js b/src/metadata/android_parser.js
index a4d8c68..1e4058b 100644
--- a/src/metadata/android_parser.js
+++ b/src/metadata/android_parser.js
@@ -24,7 +24,8 @@ var fs            = require('fs'),
     shell         = require('shelljs'),
     project_config= require('../config'),
     Q             = require('q'),
-    ConfigParser = require('../ConfigParser');
+    ConfigParser  = require('../ConfigParser'),
+    CordovaError  = require('../CordovaError');
 
 var default_prefs = {
     "useBrowserHistory":"true",

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/src/metadata/blackberry10_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/blackberry10_parser.js b/src/metadata/blackberry10_parser.js
index a9fb9e6..30a5117 100644
--- a/src/metadata/blackberry10_parser.js
+++ b/src/metadata/blackberry10_parser.js
@@ -22,7 +22,8 @@ var fs            = require('fs'),
     util          = require('../util'),
     Q             = require('q'),
     child_process = require('child_process'),
-    ConfigParser = require('../ConfigParser'),
+    ConfigParser  = require('../ConfigParser'),
+    CordovaError  = require('../CordovaError'),
     events        = require('../events'),
     config        = require('../config');
 

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/src/metadata/ios_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/ios_parser.js b/src/metadata/ios_parser.js
index 7087248..ae3280a 100644
--- a/src/metadata/ios_parser.js
+++ b/src/metadata/ios_parser.js
@@ -24,7 +24,8 @@ var fs            = require('fs'),
     shell         = require('shelljs'),
     plist         = require('plist-with-patches'),
     Q             = require('q'),
-    ConfigParser = require('../ConfigParser'),
+    ConfigParser  = require('../ConfigParser'),
+    CordovaError  = require('../CordovaError'),
     config        = require('../config');
 
 module.exports = function ios_parser(project) {

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/src/metadata/ubuntu_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/ubuntu_parser.js b/src/metadata/ubuntu_parser.js
index 2b68550..947fb1e 100644
--- a/src/metadata/ubuntu_parser.js
+++ b/src/metadata/ubuntu_parser.js
@@ -26,8 +26,9 @@ var fs            = require('fs'),
     shell         = require('shelljs'),
     project_config= require('../config'),
     Q             = require('q'),
-    os             = require('os'),
-    ConfigParser = require('../ConfigParser');
+    os            = require('os'),
+    ConfigParser  = require('../ConfigParser'),
+    CordovaError  = require('../CordovaError');
 
 module.exports = function(project) {
     this.path = project;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/src/metadata/windows8_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/windows8_parser.js b/src/metadata/windows8_parser.js
index 16a8bbc..48e98b7 100644
--- a/src/metadata/windows8_parser.js
+++ b/src/metadata/windows8_parser.js
@@ -25,7 +25,8 @@ var fs            = require('fs'),
     events        = require('../events'),
     Q             = require('q'),
     child_process = require('child_process'),
-    ConfigParser = require('../ConfigParser'),
+    ConfigParser  = require('../ConfigParser'),
+    CordovaError  = require('../CordovaError'),
     xml           = require('../xml-helpers'),
     config        = require('../config'),
     hooker        = require('../hooker');

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/src/metadata/wp7_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/wp7_parser.js b/src/metadata/wp7_parser.js
index d03c81b..039921a 100644
--- a/src/metadata/wp7_parser.js
+++ b/src/metadata/wp7_parser.js
@@ -25,7 +25,8 @@ var fs            = require('fs'),
     shell         = require('shelljs'),
     child_process = require('child_process'),
     Q             = require('q'),
-    ConfigParser = require('../ConfigParser'),
+    ConfigParser  = require('../ConfigParser'),
+    CordovaError  = require('../CordovaError'),
     config        = require('../config'),
     hooker        = require('../hooker');
 

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4f4dc29a/src/metadata/wp8_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/wp8_parser.js b/src/metadata/wp8_parser.js
index 8f9c6aa..7f2663c 100644
--- a/src/metadata/wp8_parser.js
+++ b/src/metadata/wp8_parser.js
@@ -24,7 +24,8 @@ var fs            = require('fs'),
     shell         = require('shelljs'),
     child_process = require('child_process'),
     Q             = require('q'),
-    ConfigParser = require('../ConfigParser'),
+    ConfigParser  = require('../ConfigParser'),
+    CordovaError  = require('../CordovaError'),
     xml           = require('../xml-helpers'),
     config        = require('../config'),
     hooker        = require('../hooker');


Mime
View raw message