Updated Branches: refs/heads/cordova-client 751a959d7 -> bb485e10e
fixed tests. small logic fix. updates to readme Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/commit/bb485e10 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/tree/bb485e10 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/diff/bb485e10 Branch: refs/heads/cordova-client Commit: bb485e10e393fd789b13df298af737d9fc87eae6 Parents: 751a959 Author: Fil Maj <maj....@gmail.com> Authored: Wed Aug 29 16:21:52 2012 -0700 Committer: Fil Maj <maj....@gmail.com> Committed: Wed Aug 29 16:21:52 2012 -0700 ---------------------------------------------------------------------- README.md | 14 ++++-------- spec/create.spec.js | 10 ++++---- spec/platform.spec.js | 45 +++++++++++++++---------------------------- src/platform.js | 2 +- 4 files changed, 27 insertions(+), 44 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/bb485e10/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md index 513b4ee..8c7a2f0 100644 --- a/README.md +++ b/README.md @@ -9,19 +9,18 @@ # Requirements -Cordova client requires [nodejs](http://nodejs.org/). +cordova-client requires [nodejs](http://nodejs.org/). For every platform that Cordova supports and you want to use with cordova-client, you will need to install the SDK for that platform. See: - [iOS SDK](http://developer.apple.com) - [Android SDK](http://developer.android.com) -- [BlackBerry WebWorks SDK](http://developer.blackberry.com) -Cordova client has been tested on Mas OS X _only_. Sorry. +cordova-client has been tested on Mas OS X _only_. Sorry. -In it's prototype stages, cordova-client will only work on Cordova v2.1 -and above. +In it's prototype stages, cordova-client will only work on Cordova +v2.1.0rc1 and above. # Getting Started @@ -148,9 +147,6 @@ mocks/stubs that we override for testing purposes. ## TO-DO -- verify android 2.1 support -- verify ios 2.1 support -- figure out versioning -- tests!!!! +- figure out versioning. for now: 2.1.0 minimum. - blackberry support - windows phone support http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/bb485e10/spec/create.spec.js ---------------------------------------------------------------------- diff --git a/spec/create.spec.js b/spec/create.spec.js index 777debe..a820274 100644 --- a/spec/create.spec.js +++ b/spec/create.spec.js @@ -1,9 +1,9 @@ var cordova = require('../cordova'), - wrench = require('wrench'), - mkdirp = wrench.mkdirSyncRecursive, - path = require('path'), - rmrf = wrench.rmdirSyncRecursive, - fs = require('fs'), + wrench = require('wrench'), + mkdirp = wrench.mkdirSyncRecursive, + path = require('path'), + rmrf = wrench.rmdirSyncRecursive, + fs = require('fs'), tempDir = path.join(__dirname, '..', 'temp'); describe('create command', function () { http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/bb485e10/spec/platform.spec.js ---------------------------------------------------------------------- diff --git a/spec/platform.spec.js b/spec/platform.spec.js index 797e007..2e3f2eb 100644 --- a/spec/platform.spec.js +++ b/spec/platform.spec.js @@ -40,7 +40,7 @@ describe('platform command', function() { }).toThrow(); }); - describe('ls', function() { + describe('`ls`', function() { var cwd = process.cwd(); beforeEach(function() { @@ -59,31 +59,14 @@ describe('platform command', function() { it('should list out added platforms in a project', function() { var cb = jasmine.createSpy().andCallFake(function() { - expect(cordova.platform('ls')).toEqual('android'); - }); - - process.chdir(tempDir); - runs(function() { - cordova.platform('add', 'android', cb); - }); - waitsFor(function() { return cb.wasCalled; }, "create callback"); - }); - }); - - describe('add', function() { - var cwd = process.cwd(); - - beforeEach(function() { - cordova.create(tempDir); - }); - - afterEach(function() { - process.chdir(cwd); - }); - - it('should add a supported platform', function() { - var cb = jasmine.createSpy().andCallFake(function() { - expect(cordova.platform('ls')).toEqual('android'); + var cbtwo = jasmine.createSpy().andCallFake(function() { + expect(cordova.platform('ls')).toEqual('android\nios'); + }); + runs(function() { + expect(cordova.platform('ls')).toEqual('android'); + cordova.platform('add', 'ios', cbtwo); + }); + waitsFor(function() { return cbtwo.wasCalled; }, "create callback number two"); }); process.chdir(tempDir); @@ -108,14 +91,18 @@ describe('platform command', function() { it('should remove a supported and added platform', function() { var cb = jasmine.createSpy().andCallFake(function() { cordova.platform('remove', 'android'); - expect(cordova.platform('ls')).toEqual('No platforms added. Use `cordova platform add <platform>`.'); + expect(cordova.platform('ls')).toEqual('ios'); + }); + var cbone = jasmine.createSpy().andCallFake(function() { + cordova.platform('add', 'android', cb); + waitsFor(function() { return cb.wasCalled; }, "android create callback"); }); process.chdir(tempDir); runs(function() { - cordova.platform('add', 'android', cb); + cordova.platform('add', 'ios', cbone); }); - waitsFor(function() { return cb.wasCalled; }, "create callback"); + waitsFor(function() { return cbone.wasCalled; }, "ios create callback"); }); }); }); http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/bb485e10/src/platform.js ---------------------------------------------------------------------- diff --git a/src/platform.js b/src/platform.js index 28cee54..e82e5fa 100644 --- a/src/platform.js +++ b/src/platform.js @@ -36,7 +36,6 @@ module.exports = function platform(command, target, callback) { asyncblock(function(flow) { // Add the platform to the config.xml cfg.add_platform(target); - var output = path.join(projectRoot, 'platforms', target); // Do we have the cordova library for this platform? @@ -95,6 +94,7 @@ module.exports = function platform(command, target, callback) { throw ('An error occured during creation of ' + target + ' sub-project. ' + bfrs.err); } } + callback(); }); break; case 'remove':