cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmo...@apache.org
Subject git commit: [android] fixing failing android parser spec tests.
Date Thu, 28 Nov 2013 16:16:33 GMT
Updated Branches:
  refs/heads/master 42f4d49fc -> 758d752b8


[android] fixing failing android parser spec tests.

Adding back config_parser since it was accidentally removed.
Removing poor tests that tested that the CLI check reqs directly
instead of calling out to platform scripts which we do now.
Those tests also were hard coded for API version 17, and had bugs
where some references were to API version 15 even.  About time we
remove them.


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

Branch: refs/heads/master
Commit: 758d752b857fc72d60fa406a1c18f23acdc1652f
Parents: 42f4d49
Author: Michal Mocny <mmocny@gmail.com>
Authored: Thu Nov 28 11:11:37 2013 -0500
Committer: Michal Mocny <mmocny@gmail.com>
Committed: Thu Nov 28 11:14:22 2013 -0500

----------------------------------------------------------------------
 spec/metadata/android_parser.spec.js | 28 ----------------------------
 src/metadata/android_parser.js       |  1 +
 2 files changed, 1 insertion(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/758d752b/spec/metadata/android_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/android_parser.spec.js b/spec/metadata/android_parser.spec.js
index e0f438b..92e15e1 100644
--- a/spec/metadata/android_parser.spec.js
+++ b/spec/metadata/android_parser.spec.js
@@ -80,34 +80,6 @@ describe('android project parser', function() {
                 expect(err).toContain('there was an errorz!');
             });
         });
-        it('should fire a callback if `android list target` does not return anything containing
"android-17"', function(done) {
-            exec.andCallFake(function(cmd, opts, cb) {
-                if (!cb) cb = opts;
-                cb(0, 'android-15', '');
-            });
-            errorWrapper(platforms.android.parser.check_requirements(proj), done, function(err)
{
-                expect(err).toEqual(new Error('Please install Android target 17 (the Android
4.2 SDK). Make sure you have the latest Android tools installed as well. Run `android` from
your command-line to install/update any missing SDKs or tools.'));
-            });
-        });
-        it('should check that `android` is on the path by calling `android list target`',
function(done) {
-            wrapper(platforms.android.parser.check_requirements(proj), done, function() {
-                expect(exec).toHaveBeenCalledWith('android list target', jasmine.any(Function));
-            });
-        });
-        it('should check that we can update an android project by calling `android update
project` on stock android path', function(done) {
-            wrapper(platforms.android.parser.check_requirements(proj), done, function() {
-                expect(exec.mostRecentCall.args[0]).toMatch(/^android update project -p .*
-t android-17$/gi);
-                expect(exec.mostRecentCall.args[0]).toContain(util.libDirectory);
-            });
-        });
-        it('should check that we can update an android project by calling `android update
project` on a custom path if it is so defined', function(done) {
-            var custom_path = path.join('some', 'custom', 'path', 'to', 'android', 'lib');
-            custom.andReturn(custom_path);
-            wrapper(platforms.android.parser.check_requirements(proj), done, function() {
-                expect(exec.mostRecentCall.args[0]).toMatch(/^android update project -p .*
-t android-17$/gi);
-                expect(exec.mostRecentCall.args[0]).toContain(custom_path);
-            });
-        });
     });
 
     describe('instance', function() {

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/758d752b/src/metadata/android_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/android_parser.js b/src/metadata/android_parser.js
index aeda478..4ed4ef9 100644
--- a/src/metadata/android_parser.js
+++ b/src/metadata/android_parser.js
@@ -25,6 +25,7 @@ var fs            = require('fs'),
     child_process = require('child_process'),
     project_config= require('../config'),
     Q             = require('q'),
+    config_parser = require('../config_parser'),
     lazy_load     = require('../lazy_load');
 
 var default_prefs = {


Mime
View raw message