CB-12640: flipped avd parsing logic so that it always tries to use avdmanager to retrieve avds first, then falls back to android command if avdmanager cannot be found (and errors with ENOENT). updated tests - and added explicit tests to ensure to shell out to singular forms of sub-commands when executing android

This commit is contained in:
filmaj
2017-04-06 13:48:58 -07:00
parent 765c4ee9f6
commit 6ef2f67ae8
3 changed files with 36 additions and 24 deletions
+6
View File
@@ -26,6 +26,12 @@ var Q = require("q");
describe("android_sdk", function () {
describe("list_targets_with_android", function() {
it("should invoke `android` with the `list target` command and _not_ the `list targets` command, as the plural form is not supported in some Android SDK Tools versions", function() {
var deferred = Q.defer();
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
android_sdk.list_targets_with_android();
expect(superspawn.spawn).toHaveBeenCalledWith("android", ["list", "target"]);
});
it("should parse and return results from `android list targets` command", function(done) {
var deferred = Q.defer();
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);