incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject git commit: Remove weird characters from default package name + app name. Was throwing errors on older macs. Fixes #42
Date Sat, 06 Oct 2012 01:52:09 GMT
Updated Branches:
  refs/heads/cordova-client 79407964b -> 3cb56db67


Remove weird characters from default package name + app name. Was throwing errors on older
macs. Fixes #42


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/3cb56db6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/tree/3cb56db6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/diff/3cb56db6

Branch: refs/heads/cordova-client
Commit: 3cb56db67e41d7188b8b0268356826d876ee4b20
Parents: 7940796
Author: Fil Maj <maj.fil@gmail.com>
Authored: Fri Oct 5 18:51:51 2012 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Fri Oct 5 18:51:51 2012 -0700

----------------------------------------------------------------------
 package.json         |    2 +-
 spec/cordova.spec.js |  176 +++++++++++++++++++++++++++++++++++++++++++++
 src/create.js        |    4 +-
 src/events.js        |    5 ++
 4 files changed, 184 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/3cb56db6/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 016b3fb..f1f15b2 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova",
-  "version": "0.1.1",
+  "version": "0.1.2",
   "preferGlobal": "true",
   "description": "Cordova client tool",
   "main": "cordova",

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/3cb56db6/spec/cordova.spec.js
----------------------------------------------------------------------
diff --git a/spec/cordova.spec.js b/spec/cordova.spec.js
new file mode 100644
index 0000000..e7fdd04
--- /dev/null
+++ b/spec/cordova.spec.js
@@ -0,0 +1,176 @@
+var cordova = require('../cordova'),
+    path = require('path'),
+    shell = require('shelljs'),
+    androidPlugin = path.join(__dirname, 'fixtures', 'plugins', 'android'),
+    tempDir = path.join(__dirname, '..', 'temp');
+
+var cwd = process.cwd();
+
+describe('top-level cordova module', function() {
+    beforeEach(function() {
+        cordova.create(tempDir);
+        process.chdir(tempDir);
+    });
+    afterEach(function() {
+        shell.rm('-rf', tempDir);
+        process.chdir(cwd);
+    });
+
+    describe('hooks/events', function() {
+        describe('for build command', function() {
+            beforeEach(function() {
+                cordova.platform('add', 'android');
+            });
+            it('should fire before_build event', function() {
+                var s = jasmine.createSpy('event listener');
+                cordova.on('before_build', s);
+                spyOn(shell, 'exec').andReturn({code:0});
+                cordova.build();
+                expect(s).toHaveBeenCalled();
+            });
+            it('should fire after_build event', function() {
+                var s = jasmine.createSpy('event listener');
+                cordova.on('after_build', s);
+                spyOn(shell, 'exec').andReturn({code:0});
+                cordova.build();
+                expect(s).toHaveBeenCalled();
+            });
+        });
+        
+        describe('for docs command', function() {
+            // TODO how the f do you spy on express? srsly
+            xit('should fire before_docs event', function() {
+                var s = jasmine.createSpy('event listener');
+                cordova.on('before_docs', s);
+                cordova.docs();
+                expect(s).toHaveBeenCalled();
+            });
+            xit('should fire after_docs event', function() {
+                var s = jasmine.createSpy('event listener');
+                cordova.on('after_docs', s);
+                cordova.docs();
+                expect(s).toHaveBeenCalled();
+            });
+        });
+
+        describe('for emulate command', function() {
+            beforeEach(function() {
+                cordova.platform('add', 'android');
+            });
+            it('should fire before_emulate event', function() {
+                var s = jasmine.createSpy('event listener');
+                cordova.on('before_emulate', s);
+                spyOn(shell, 'exec').andReturn({code:0});
+                cordova.emulate();
+                expect(s).toHaveBeenCalled();
+            });
+            it('should fire after_emulate event', function() {
+                var s = jasmine.createSpy('event listener');
+                cordova.on('after_emulate', s);
+                spyOn(shell, 'exec').andReturn({code:0});
+                cordova.emulate();
+                expect(s).toHaveBeenCalled();
+            });
+        });
+
+        describe('for platform command', function() {
+            describe('`add`', function() {
+                it('should fire before_platform_add event', function() {
+                    var s = jasmine.createSpy('event listener');
+                    cordova.on('before_platform_add', s);
+                    cordova.platform('add', 'android');
+                    expect(s).toHaveBeenCalled();
+                });
+                it('should fire after_platform_add event', function() {
+                    var s = jasmine.createSpy('event listener');
+                    cordova.on('after_platform_add', s);
+                    cordova.platform('add', 'android');
+                    expect(s).toHaveBeenCalled();
+                });
+            });
+            describe('`rm`', function() {
+                beforeEach(function() {
+                    cordova.platform('add', 'android');
+                });
+                it('should fire before_platform_rm event', function() {
+                    var s = jasmine.createSpy('event listener');
+                    cordova.on('before_platform_rm', s);
+                    cordova.platform('rm', 'android');
+                    expect(s).toHaveBeenCalled();
+                });
+                it('should fire after_platform_rm event', function() {
+                    var s = jasmine.createSpy('event listener');
+                    cordova.on('after_platform_rm', s);
+                    cordova.platform('rm', 'android');
+                    expect(s).toHaveBeenCalled();
+                });
+            });
+            describe('`ls`', function() {
+                it('should fire before_platform_ls event', function() {
+                    var s = jasmine.createSpy('event listener');
+                    cordova.on('before_platform_ls', s);
+                    cordova.platform('ls');
+                    expect(s).toHaveBeenCalled();
+                });
+                it('should fire after_platform_ls event', function() {
+                    var s = jasmine.createSpy('event listener');
+                    cordova.on('after_platform_ls', s);
+                    cordova.platform('ls');
+                    expect(s).toHaveBeenCalled();
+                });
+            });
+        });
+
+        describe('for plugin command', function() {
+            describe('`add`', function() {
+                beforeEach(function() {
+                    cordova.platform('add', 'android');
+                });
+                it('should fire before_plugin_add event', function() {
+                    var s = jasmine.createSpy('event listener');
+                    cordova.on('before_plugin_add', s);
+                    cordova.plugin('add', androidPlugin);
+                    expect(s).toHaveBeenCalled();
+                });
+                it('should fire after_plugin_add event', function() {
+                    var s = jasmine.createSpy('event listener');
+                    cordova.on('after_plugin_add', s);
+                    cordova.plugin('add', androidPlugin);
+                    expect(s).toHaveBeenCalled();
+                });
+            });
+            describe('`rm`', function() {
+                beforeEach(function() {
+                    cordova.platform('add', 'android');
+                    cordova.plugin('add', androidPlugin);
+                });
+                it('should fire before_plugin_rm event', function() {
+                    var s = jasmine.createSpy('event listener');
+                    cordova.on('before_plugin_rm', s);
+                    cordova.plugin('rm', 'android');
+                    expect(s).toHaveBeenCalled();
+                });
+                it('should fire after_plugin_rm event', function() {
+                    var s = jasmine.createSpy('event listener');
+                    cordova.on('after_plugin_rm', s);
+                    cordova.plugin('rm', 'android');
+                    expect(s).toHaveBeenCalled();
+                });
+            });
+            describe('`ls`', function() {
+                it('should fire before_plugin_ls event', function() {
+                    var s = jasmine.createSpy('event listener');
+                    cordova.on('before_plugin_ls', s);
+                    cordova.plugin('ls');
+                    expect(s).toHaveBeenCalled();
+                });
+                it('should fire after_plugin_ls event', function() {
+                    var s = jasmine.createSpy('event listener');
+                    cordova.on('after_plugin_ls', s);
+                    cordova.plugin('ls');
+                    expect(s).toHaveBeenCalled();
+                });
+            });
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/3cb56db6/src/create.js
----------------------------------------------------------------------
diff --git a/src/create.js b/src/create.js
index d99b04c..ca69e31 100644
--- a/src/create.js
+++ b/src/create.js
@@ -4,8 +4,8 @@ var path          = require('path'),
     help          = require('./help'),
     config_parser = require('./config_parser');
 
-var DEFAULT_NAME = "Hello Cordova",
-    DEFAULT_ID   = "io.cordova.hello-cordova";
+var DEFAULT_NAME = "HelloCordova",
+    DEFAULT_ID   = "io.cordova.hellocordova";
 
 /**
  * Usage:

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/3cb56db6/src/events.js
----------------------------------------------------------------------
diff --git a/src/events.js b/src/events.js
new file mode 100644
index 0000000..8d46c14
--- /dev/null
+++ b/src/events.js
@@ -0,0 +1,5 @@
+var events = require('events');
+
+var emitter = new events.EventEmitter();
+
+module.exports = emitter;


Mime
View raw message