You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2014/03/27 22:49:37 UTC
[2/3] git commit: CB-6338 Improve error for missing template
CB-6338 Improve error for missing template
Fix create test to properly lie about lib/dir
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/da34130e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/da34130e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/da34130e
Branch: refs/heads/master
Commit: da34130e063da5d4e4c5ab96cb75d1e47e3a7581
Parents: 4f4dc29
Author: Josh Soref <js...@blackberry.com>
Authored: Wed Mar 26 11:58:30 2014 -0400
Committer: Josh Soref <js...@blackberry.com>
Committed: Wed Mar 26 11:58:59 2014 -0400
----------------------------------------------------------------------
spec/create.spec.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/da34130e/spec/create.spec.js
----------------------------------------------------------------------
diff --git a/spec/create.spec.js b/spec/create.spec.js
index ec72104..8381a6a 100644
--- a/spec/create.spec.js
+++ b/spec/create.spec.js
@@ -56,7 +56,10 @@ describe('create command', function () {
config_spy = spyOn(cordova, 'config');
config_read = spyOn(config, 'read').andReturn({});
config_write = spyOn(config, 'write').andReturn({});
- exists = spyOn(fs, 'existsSync').andReturn(false);
+ exists = spyOn(fs, 'existsSync').andCallFake(function(p) {
+ if (p == 'lib/dir') return true;
+ return false;
+ });
load_cordova = spyOn(lazy_load, 'cordova').andReturn(Q(path.join('lib','dir')));
load_custom = spyOn(lazy_load, 'custom').andReturn(Q(path.join('lib','dir')));
spyOn(ConfigParser.prototype, 'write');
@@ -162,6 +165,7 @@ describe('create command', function () {
});
it('should not replace an existing www/config.xml', function(done) {
exists.andCallFake(function(p) {
+ if (p == 'lib/dir') return true;
if (p.indexOf('config.xml') > -1) return true;
return false;
});