You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2012/11/28 19:16:23 UTC
[1/50] git commit: Remove commented junk from serve.spec.js
Updated Branches:
refs/heads/master [created] d864b0423
Remove commented junk from serve.spec.js
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/d864b042
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/d864b042
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/d864b042
Branch: refs/heads/master
Commit: d864b0423a0dd724ef05b18e9ce56f5552692731
Parents: 50a2e54
Author: Braden Shepherdson <br...@chromium.org>
Authored: Wed Nov 21 17:03:16 2012 -0500
Committer: Braden Shepherdson <br...@chromium.org>
Committed: Wed Nov 21 17:03:16 2012 -0500
----------------------------------------------------------------------
spec/serve.spec.js | 214 -----------------------------------------------
1 files changed, 0 insertions(+), 214 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/d864b042/spec/serve.spec.js
----------------------------------------------------------------------
diff --git a/spec/serve.spec.js b/spec/serve.spec.js
index 81c03ce..1de754e 100644
--- a/spec/serve.spec.js
+++ b/spec/serve.spec.js
@@ -111,217 +111,3 @@ describe('serve command', function() {
});
});
-/*
-
- describe('without any libraries cloned', function() {
- var lib = path.join(__dirname, '..', 'lib');
- var libs = fs.readdirSync(lib);
-
- beforeEach(function() {
- libs.forEach(function(p) {
- var s = path.join(lib, p);
- var d = path.join(lib, p + '-bkup');
- shell.mv(s, d);
- });
- });
- afterEach(function() {
- libs.forEach(function(p) {
- var s = path.join(lib, p + '-bkup', '*');
- var d = path.join(lib, p);
- shell.mkdir(d);
- shell.mv(s, d);
- shell.rm('-rf', path.join(lib, p + '-bkup'));
- });
- });
- it('should download the android library', function() {
- var s = spyOn(request, 'get');
- try {
- cordova.platform('add', 'android', function() {});
- } catch(e) {}
-
- expect(s).toHaveBeenCalled();
- expect(s.calls[0].args[0]).toMatch(/cordova-android\/zipball/);
- });
- it('should download the ios library', function() {
- var s = spyOn(request, 'get');
- try {
- cordova.platform('add', 'ios', function() {});
- } catch(e) {}
-
- expect(s).toHaveBeenCalled();
- expect(s.calls[0].args[0]).toMatch(/cordova-ios\/zipball/);
- });
- it('should download the blackberry library', function() {
- var s = spyOn(request, 'get');
- try {
- cordova.platform('add', 'blackberry', function() {});
- } catch(e) {}
-
- expect(s).toHaveBeenCalled();
- expect(s.calls[0].args[0]).toMatch(/cordova-blackberry-webworks\/zipball/);
- });
- it('should add a basic android project');
- it('should add a basic ios project');
- it('should add a basic blackberry project');
- });
-
- describe('android', function() {
- it('should add a basic android project', function() {
- cordova.platform('add', 'android');
- expect(fs.existsSync(path.join(tempDir, 'platforms', 'android', 'AndroidManifest.xml'))).toBe(true);
- });
- it('should call android_parser\'s update_project', function() {
- var s = spyOn(android_parser.prototype, 'update_project');
- cordova.platform('add', 'android');
- expect(s).toHaveBeenCalled();
- });
- });
- describe('ios', function() {
- it('should add a basic ios project', function() {
- var cb = jasmine.createSpy();
-
- runs(function() {
- cordova.platform('add', 'ios', cb);
- });
- waitsFor(function() { return cb.wasCalled; }, "platform add ios callback");
- runs(function() {
- expect(fs.existsSync(path.join(tempDir, 'platforms', 'ios', 'www'))).toBe(true);
- });
- });
- it('should call ios_parser\'s update_project', function() {
- var s = spyOn(ios_parser.prototype, 'update_project');
- cordova.platform('add', 'ios');
- expect(s).toHaveBeenCalled();
- });
- it('should error out if user does not have xcode 4.5 or above installed', function() {
- var s = spyOn(shell, 'exec').andReturn({code:0,output:'Xcode 4.2.1'});
- expect(function() {
- cordova.platform('add', 'ios');
- }).toThrow();
- });
- it('should error out if user does not have xcode installed at all', function() {
- var s = spyOn(shell, 'exec').andReturn({code:1});
- expect(function() {
- cordova.platform('add', 'ios');
- }).toThrow();
- });
- });
- describe('blackberry-10', function() {
- it('should add a basic blackberry project', function() {
- var cb = jasmine.createSpy();
- var s = spyOn(require('prompt'), 'get').andReturn(true);
-
- runs(function() {
- cordova.platform('add', 'blackberry-10', cb);
- s.mostRecentCall.args[1](null, {}); // fake out prompt
- });
- waitsFor(function() { return cb.wasCalled; }, "platform add blackberry");
- runs(function() {
- expect(fs.existsSync(path.join(tempDir, 'platforms', 'blackberry-10', 'www'))).toBe(true);
- });
- });
- it('should call blackberry_parser\'s update_project', function() {
- var s = spyOn(blackberry_parser.prototype, 'update_project');
- cordova.platform('add', 'blackberry-10');
- expect(s).toHaveBeenCalled();
- });
- });
- it('should handle multiple platforms', function() {
- var cb = jasmine.createSpy();
- runs(function() {
- cordova.platform('add', ['android', 'ios'], cb);
- });
- waitsFor(function() { return cb.wasCalled; }, "platform add ios+android callback");
- runs(function() {
- expect(fs.existsSync(path.join(tempDir, 'platforms', 'android', 'AndroidManifest.xml'))).toBe(true);
- expect(fs.existsSync(path.join(tempDir, 'platforms', 'ios', 'www'))).toBe(true);
- });
- });
- });
-
- var removing_tests = function(_invocation) {
- return function() {
- beforeEach(function() {
- cordova.create(tempDir);
- process.chdir(tempDir);
- });
-
- afterEach(function() {
- process.chdir(cwd);
- });
-
- it('should remove a supported and added platform', function() {
- var cb = jasmine.createSpy();
-
- runs(function() {
- cordova.platform('add', ['android', 'ios'], cb);
- });
- waitsFor(function() { return cb.wasCalled; }, "android+ios platfomr add callback");
- runs(function() {
- cordova.platform(_invocation, 'android');
- expect(cordova.platform('ls').length).toEqual(1);
- expect(cordova.platform('ls')[0]).toEqual('ios');
- });
- });
- it('should be able to remove multiple platforms', function() {
- var cb = jasmine.createSpy();
-
- runs(function() {
- cordova.platform('add', ['android', 'ios'], cb);
- });
- waitsFor(function() { return cb.wasCalled; }, "android+ios platfomr add callback");
- runs(function() {
- cordova.platform(_invocation, ['android','ios']);
- expect(cordova.platform('ls').length).toEqual(0);
- });
- });
- };
- };
- describe('`rm`', removing_tests('rm'));
- describe('`remove`', removing_tests('remove'));
-
- describe('hooks', function() {
- var s;
- beforeEach(function() {
- cordova.create(tempDir);
- process.chdir(tempDir);
- s = spyOn(hooker.prototype, 'fire').andReturn(true);
- });
- afterEach(function() {
- process.chdir(cwd);
- shell.rm('-rf', tempDir);
- });
-
- describe('list (ls) hooks', function() {
- it('should fire before hooks through the hooker module', function() {
- cordova.platform();
- expect(s).toHaveBeenCalledWith('before_platform_ls');
- });
- it('should fire after hooks through the hooker module', function() {
- cordova.platform();
- expect(s).toHaveBeenCalledWith('after_platform_ls');
- });
- });
- describe('remove (rm) hooks', function() {
- it('should fire before hooks through the hooker module', function() {
- cordova.platform('rm', 'android');
- expect(s).toHaveBeenCalledWith('before_platform_rm');
- });
- it('should fire after hooks through the hooker module', function() {
- cordova.platform('rm', 'android');
- expect(s).toHaveBeenCalledWith('after_platform_rm');
- });
- });
- describe('add hooks', function() {
- it('should fire before hooks through the hooker module', function() {
- cordova.platform('add', 'android');
- expect(s).toHaveBeenCalledWith('before_platform_add');
- });
- it('should fire after hooks through the hooker module', function() {
- cordova.platform('add', 'android');
- expect(s).toHaveBeenCalledWith('after_platform_add');
- });
- });
- });
-});
-*/