You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2018/12/12 00:09:51 UTC
[cordova-node-xcode] branch master updated: Remove trailing
whitespace from test/*.js (#34)
This is an automated email from the ASF dual-hosted git repository.
brodybits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-node-xcode.git
The following commit(s) were added to refs/heads/master by this push:
new db42242 Remove trailing whitespace from test/*.js (#34)
db42242 is described below
commit db422427dd41d8f695befb33234809c8cf8305de
Author: Chris Brody <ch...@gmail.com>
AuthorDate: Tue Dec 11 19:09:47 2018 -0500
Remove trailing whitespace from test/*.js (#34)
---
test/addBuildPhase.js | 26 +++++++++++++-------------
test/addHeaderFile.js | 2 +-
test/addRemovePbxGroup.js | 28 ++++++++++++++--------------
test/addResourceFile.js | 8 ++++----
test/addSourceFile.js | 2 +-
test/addStaticLibrary.js | 4 ++--
test/addTarget.js | 21 ++++++++++-----------
test/addTargetDependency.js | 32 ++++++++++++++++----------------
test/addToPbxFileReferenceSection.js | 6 +++---
test/addXCConfigurationList.js | 8 ++++----
test/multipleTargets.js | 30 +++++++++++++++---------------
test/pbxItemByComment.js | 8 ++++----
test/pbxProject.js | 2 +-
test/pbxTargetByName.js | 4 ++--
test/removeHeaderFile.js | 24 ++++++++++++------------
test/removeResourceFile.js | 26 +++++++++++++-------------
16 files changed, 115 insertions(+), 116 deletions(-)
diff --git a/test/addBuildPhase.js b/test/addBuildPhase.js
index 987ab34..1964fec 100644
--- a/test/addBuildPhase.js
+++ b/test/addBuildPhase.js
@@ -32,7 +32,7 @@ exports.setUp = function (callback) {
exports.addBuildPhase = {
'should return a pbxBuildPhase': function (test) {
var buildPhase = proj.addBuildPhase(['file.m'], 'PBXSourcesBuildPhase', 'My build phase');
-
+
test.ok(typeof buildPhase === 'object');
test.done()
},
@@ -48,7 +48,7 @@ exports.addBuildPhase = {
var file = buildPhase.files[index];
test.ok(file.value);
}
-
+
test.done()
},
'should add the PBXBuildPhase object correctly': function (test) {
@@ -64,11 +64,11 @@ exports.addBuildPhase = {
'should add each of the files to PBXBuildFile section': function (test) {
var buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase,
buildFileSection = proj.pbxBuildFileSection();
-
+
for (var index = 0; index < buildPhase.files.length; index++) {
var file = buildPhase.files[index];
test.ok(buildFileSection[file.value]);
- }
+ }
test.done();
},
@@ -77,12 +77,12 @@ exports.addBuildPhase = {
fileRefSection = proj.pbxFileReferenceSection(),
buildFileSection = proj.pbxBuildFileSection(),
fileRefs = [];
-
+
for (var index = 0; index < buildPhase.files.length; index++) {
var file = buildPhase.files[index],
fileRef = buildFileSection[file.value].fileRef;
-
- test.ok(fileRefSection[fileRef]);
+
+ test.ok(fileRefSection[fileRef]);
}
test.done();
@@ -92,7 +92,7 @@ exports.addBuildPhase = {
initialFileReferenceSectionItemsCount = Object.keys(fileRefSection),
buildPhase = proj.addBuildPhase(['AppDelegate.m', 'main.m'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase,
afterAdditionBuildFileSectionItemsCount = Object.keys(fileRefSection);
-
+
test.deepEqual(initialFileReferenceSectionItemsCount, afterAdditionBuildFileSectionItemsCount);
test.done();
},
@@ -101,7 +101,7 @@ exports.addBuildPhase = {
initialBuildFileSectionItemsCount = Object.keys(buildFileSection),
buildPhase = proj.addBuildPhase(['AppDelegate.m', 'main.m'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase,
afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection);
-
+
test.deepEqual(initialBuildFileSectionItemsCount, afterAdditionBuildFileSectionItemsCount);
test.done();
},
@@ -111,14 +111,14 @@ exports.addBuildPhase = {
initialFileReferenceSectionItemsCount = Object.keys(fileRefSection),
buildPhase = proj.addBuildPhase(['file.m', 'AppDelegate.m'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase,
afterAdditionBuildFileSectionItemsCount = Object.keys(fileRefSection);
-
+
for (var index = 0; index < buildPhase.files.length; index++) {
var file = buildPhase.files[index],
fileRef = buildFileSection[file.value].fileRef;
-
- test.ok(fileRefSection[fileRef]);
+
+ test.ok(fileRefSection[fileRef]);
}
-
+
test.deepEqual(initialFileReferenceSectionItemsCount.length, afterAdditionBuildFileSectionItemsCount.length - 2);
test.done();
},
diff --git a/test/addHeaderFile.js b/test/addHeaderFile.js
index 0837f11..f9bd71a 100644
--- a/test/addHeaderFile.js
+++ b/test/addHeaderFile.js
@@ -94,7 +94,7 @@ exports.addHeaderFile = {
},
'duplicate entries': {
'should return false': function (test) {
- var newFile = proj.addHeaderFile('Plugins/file.h');
+ var newFile = proj.addHeaderFile('Plugins/file.h');
test.ok(!proj.addHeaderFile('Plugins/file.h'));
test.done();
diff --git a/test/addRemovePbxGroup.js b/test/addRemovePbxGroup.js
index a6a9aca..8212f91 100644
--- a/test/addRemovePbxGroup.js
+++ b/test/addRemovePbxGroup.js
@@ -32,7 +32,7 @@ exports.setUp = function (callback) {
exports.addRemovePbxGroup = {
'should return a pbxGroup': function (test) {
var pbxGroup = proj.addPbxGroup(['file.m'], 'MyGroup', 'Application', 'Application', '"<group>"');
-
+
test.ok(typeof pbxGroup === 'object');
test.done()
},
@@ -48,7 +48,7 @@ exports.addRemovePbxGroup = {
var file = pbxGroup.pbxGroup.children[index];
test.ok(file.value);
}
-
+
test.done()
},
'should add the PBXGroup object correctly': function (test) {
@@ -74,7 +74,7 @@ exports.addRemovePbxGroup = {
test.notEqual(buildFileSection[key].fileRef_comment, 'file.m');
test.notEqual(buildFileSection[key].fileRef_comment, 'assets.bundle');
}
-
+
var initialBuildFileSectionItemsCount = Object.keys(buildFileSection),
pbxGroup = proj.addPbxGroup(['file.m', 'assets.bundle'], 'MyGroup', 'Application', '"<group>"'),
afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection);
@@ -88,7 +88,7 @@ exports.addRemovePbxGroup = {
initialBuildFileSectionItemsCount = Object.keys(buildFileSection),
pbxGroup = proj.addPbxGroup(['AppDelegate.m', 'AppDelegate.h'], 'MyGroup', 'Application', '"<group>"'),
afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection);
-
+
test.deepEqual(initialBuildFileSectionItemsCount, afterAdditionBuildFileSectionItemsCount);
test.done();
},
@@ -97,7 +97,7 @@ exports.addRemovePbxGroup = {
initialBuildFileSectionItemsCount = Object.keys(buildFileSection),
pbxGroup = proj.addPbxGroup(['KitchenSinktablet.app'], 'MyGroup', 'Application', '"<group>"'),
afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection);
-
+
test.deepEqual(initialBuildFileSectionItemsCount, afterAdditionBuildFileSectionItemsCount);
test.done();
},
@@ -107,11 +107,11 @@ exports.addRemovePbxGroup = {
test.notEqual(buildFileSection[key].fileRef_comment, 'file.m');
test.notEqual(buildFileSection[key].fileRef_comment, 'assets.bundle');
}
-
+
var initialBuildFileSectionItemsCount = Object.keys(buildFileSection),
pbxGroup = proj.addPbxGroup(['AppDelegate.m', 'AppDelegate.h', 'file.m', 'assets.bundle'], 'MyGroup', 'Application', '"<group>"'),
afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection);
-
+
// for each file added in the build file section two keyes are added - one for the object and one for the comment
test.equal(initialBuildFileSectionItemsCount.length, afterAdditionBuildFileSectionItemsCount.length - 4);
test.done();
@@ -126,7 +126,7 @@ exports.addRemovePbxGroup = {
for (var index = 0; index < pbxGroup.pbxGroup.children.length; index++) {
var file = pbxGroup.pbxGroup.children[index];
test.ok(fileReference[file.value]);
- }
+ }
test.done();
},
@@ -135,7 +135,7 @@ exports.addRemovePbxGroup = {
initialBuildFileSectionItemsCount = Object.keys(fileReference),
pbxGroup = proj.addPbxGroup(['AppDelegate.m', 'AppDelegate.h'], 'MyGroup', 'Application', '"<group>"'),
afterAdditionBuildFileSectionItemsCount = Object.keys(fileReference);
-
+
test.deepEqual(initialBuildFileSectionItemsCount, afterAdditionBuildFileSectionItemsCount);
test.done();
},
@@ -144,7 +144,7 @@ exports.addRemovePbxGroup = {
initialBuildFileSectionItemsCount = Object.keys(fileReference),
pbxGroup = proj.addPbxGroup(['KitchenSinktablet.app'], 'MyGroup', 'Application', '"<group>"'),
afterAdditionBuildFileSectionItemsCount = Object.keys(fileReference);
-
+
test.deepEqual(initialBuildFileSectionItemsCount, afterAdditionBuildFileSectionItemsCount);
test.done();
},
@@ -154,11 +154,11 @@ exports.addRemovePbxGroup = {
test.notEqual(fileReference[key].fileRef_comment, 'file.m');
test.notEqual(fileReference[key].fileRef_comment, 'assets.bundle');
}
-
+
var initialBuildFileSectionItemsCount = Object.keys(fileReference),
pbxGroup = proj.addPbxGroup(['AppDelegate.m', 'AppDelegate.h', 'file.m', 'assets.bundle'], 'MyGroup', 'Application', '"<group>"'),
afterAdditionBuildFileSectionItemsCount = Object.keys(fileReference);
-
+
// for each file added in the file reference section two keyes are added - one for the object and one for the comment
test.equal(initialBuildFileSectionItemsCount.length, afterAdditionBuildFileSectionItemsCount.length - 4);
test.done();
@@ -167,10 +167,10 @@ exports.addRemovePbxGroup = {
var groupName = 'MyGroup';
proj.addPbxGroup(['file.m'], groupName, 'Application', 'Application', '"<group>"');
proj.removePbxGroup(groupName);
-
+
var pbxGroupInPbx = proj.pbxGroupByName(groupName);
console.log(pbxGroupInPbx);
-
+
test.ok(!pbxGroupInPbx);
test.done()
}
diff --git a/test/addResourceFile.js b/test/addResourceFile.js
index 58382d1..36afdb2 100644
--- a/test/addResourceFile.js
+++ b/test/addResourceFile.js
@@ -160,12 +160,12 @@ exports.addResourceFile = {
'should add the PBXFileReference with the "Plugins" path': function (test) {
delete proj.pbxGroupByName('Plugins').path;
-
+
var newFile = proj.addResourceFile('Plugins/assets.bundle',
{ plugin: true }),
fileRefSection = proj.pbxFileReferenceSection(),
fileRefEntry = fileRefSection[newFile.fileRef];
-
+
test.equal(fileRefEntry.isa, 'PBXFileReference');
test.equal(fileRefEntry.fileEncoding, undefined);
test.equal(fileRefEntry.lastKnownFileType, 'wrapper.plug-in');
@@ -245,14 +245,14 @@ exports.addResourceFile = {
},
'duplicate entries': {
'should return false': function (test) {
- var newFile = proj.addResourceFile('Plugins/assets.bundle');
+ var newFile = proj.addResourceFile('Plugins/assets.bundle');
test.ok(!proj.addResourceFile('Plugins/assets.bundle'));
test.done();
},
'should return false (plugin entries)': function (test) {
var newFile = proj.addResourceFile('Plugins/assets.bundle',
- { plugin: true });
+ { plugin: true });
test.ok(!proj.addResourceFile('Plugins/assets.bundle',
{ plugin: true }));
diff --git a/test/addSourceFile.js b/test/addSourceFile.js
index 5d84050..d614d62 100644
--- a/test/addSourceFile.js
+++ b/test/addSourceFile.js
@@ -146,7 +146,7 @@ exports.addSourceFile = {
},
'duplicate entries': {
'should return false': function (test) {
- var newFile = proj.addSourceFile('Plugins/file.m');
+ var newFile = proj.addSourceFile('Plugins/file.m');
test.ok(!proj.addSourceFile('Plugins/file.m'));
test.done();
diff --git a/test/addStaticLibrary.js b/test/addStaticLibrary.js
index b099901..d1b0ec6 100644
--- a/test/addStaticLibrary.js
+++ b/test/addStaticLibrary.js
@@ -251,14 +251,14 @@ exports.addStaticLibrary = {
},
'duplicate entries': {
'should return false': function (test) {
- var newFile = proj.addStaticLibrary('libGoogleAnalytics.a');
+ var newFile = proj.addStaticLibrary('libGoogleAnalytics.a');
test.ok(!proj.addStaticLibrary('libGoogleAnalytics.a'));
test.done();
},
'should return false (plugin entries)': function (test) {
var newFile = proj.addStaticLibrary('Plugins/libGoogleAnalytics.a',
- { plugin: true });
+ { plugin: true });
test.ok(!proj.addStaticLibrary('Plugins/libGoogleAnalytics.a',
{ plugin: true }));
diff --git a/test/addTarget.js b/test/addTarget.js
index 85cb8d5..6f0c85f 100644
--- a/test/addTarget.js
+++ b/test/addTarget.js
@@ -38,19 +38,19 @@ exports.addTarget = {
test.throws(function() {
proj.addTarget(null, TARGET_TYPE);
});
-
+
test.done();
},
'should throw when target type missing': function (test) {
test.throws(function() {
proj.addTarget(TARGET_NAME, null);
});
-
+
test.done();
},
'should create a new target': function (test) {
var target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME);
-
+
test.ok(typeof target == 'object');
test.ok(target.uuid);
test.ok(target.pbxNativeTarget);
@@ -63,13 +63,13 @@ exports.addTarget = {
test.ok(target.pbxNativeTarget.buildPhases);
test.ok(target.pbxNativeTarget.buildRules);
test.ok(target.pbxNativeTarget.dependencies);
-
+
test.done();
},
'should create a new target and add source, framework, resource and header files and the corresponding build phases': function (test) {
var target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME),
options = { 'target' : target.uuid };
-
+
var sourceFile = proj.addSourceFile('Plugins/file.m', options),
sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid),
resourceFile = proj.addResourceFile('assets.bundle', options),
@@ -77,16 +77,16 @@ exports.addTarget = {
frameworkFile = proj.addFramework('libsqlite3.dylib', options);
frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid),
headerFile = proj.addHeaderFile('file.h', options);
-
+
test.ok(sourcePhase);
test.ok(resourcePhase);
test.ok(frameworkPhase);
-
+
test.equal(sourceFile.constructor, pbxFile);
test.equal(resourceFile.constructor, pbxFile);
test.equal(frameworkFile.constructor, pbxFile);
test.equal(headerFile.constructor, pbxFile);
-
+
test.ok(typeof target == 'object');
test.ok(target.uuid);
test.ok(target.pbxNativeTarget);
@@ -99,8 +99,7 @@ exports.addTarget = {
test.ok(target.pbxNativeTarget.buildPhases);
test.ok(target.pbxNativeTarget.buildRules);
test.ok(target.pbxNativeTarget.dependencies);
-
+
test.done();
-
- }
+ }
}
diff --git a/test/addTargetDependency.js b/test/addTargetDependency.js
index b77ed61..4c1c419 100644
--- a/test/addTargetDependency.js
+++ b/test/addTargetDependency.js
@@ -32,7 +32,7 @@ exports.setUp = function (callback) {
exports.addTargetDependency = {
'should return undefined when no target specified': function (test) {
var buildPhase = proj.addTargetDependency();
-
+
test.ok(typeof buildPhase === 'undefined');
test.done()
},
@@ -50,7 +50,7 @@ exports.addTargetDependency = {
},
'should return the pbxTarget': function (test) {
var target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54']);
-
+
test.ok(typeof target == 'object');
test.ok(target.uuid);
test.ok(target.target);
@@ -59,7 +59,7 @@ exports.addTargetDependency = {
'should add targetDependencies to target': function (test) {
var targetInPbxProj = proj.pbxNativeTargetSection()['1D6058900D05DD3D006BFB55'];
test.deepEqual(targetInPbxProj.dependencies, []);
-
+
var target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target;
test.deepEqual(targetInPbxProj.dependencies, target.dependencies)
test.done()
@@ -67,18 +67,18 @@ exports.addTargetDependency = {
'should create a PBXTargetDependency for each dependency target': function (test) {
var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'],
target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target;
-
+
for (var index = 0; index < target.dependencies.length; index++) {
var dependency = target.dependencies[index].value;
test.ok(pbxTargetDependencySection[dependency]);
}
-
+
test.done()
},
'should set right comment for each dependency target': function (test) {
var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'],
target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target;
-
+
for (var index = 0; index < target.dependencies.length; index++) {
var dependencyCommentKey = target.dependencies[index].value + '_comment';
test.equal(pbxTargetDependencySection[dependencyCommentKey], 'PBXTargetDependency');
@@ -90,14 +90,14 @@ exports.addTargetDependency = {
var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'],
pbxContainerItemProxySection = proj.hash.project.objects['PBXContainerItemProxy'],
target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target;
-
+
for (var index = 0; index < target.dependencies.length; index++) {
var dependency = target.dependencies[index].value,
targetProxy = pbxTargetDependencySection[dependency]['targetProxy'];
test.ok(pbxContainerItemProxySection[targetProxy]);
}
-
+
test.done()
},
'should set each PBXContainerItemProxy`s remoteGlobalIDString correctly': function (test) {
@@ -105,14 +105,14 @@ exports.addTargetDependency = {
pbxContainerItemProxySection = proj.hash.project.objects['PBXContainerItemProxy'],
target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target,
remoteGlobalIDStrings = [];
-
+
for (var index = 0; index < target.dependencies.length; index++) {
var dependency = target.dependencies[index].value,
targetProxy = pbxTargetDependencySection[dependency]['targetProxy'];
remoteGlobalIDStrings.push(pbxContainerItemProxySection[targetProxy]['remoteGlobalIDString']);
}
-
+
test.deepEqual(remoteGlobalIDStrings, ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']);
test.done()
},
@@ -121,14 +121,14 @@ exports.addTargetDependency = {
pbxContainerItemProxySection = proj.hash.project.objects['PBXContainerItemProxy'],
target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target,
remoteInfoArray = [];
-
+
for (var index = 0; index < target.dependencies.length; index++) {
var dependency = target.dependencies[index].value,
targetProxy = pbxTargetDependencySection[dependency]['targetProxy'];
remoteInfoArray.push(pbxContainerItemProxySection[targetProxy]['remoteInfo']);
}
-
+
test.deepEqual(remoteInfoArray, ['"KitchenSinktablet"', '"TestApp"']);
test.done()
},
@@ -136,28 +136,28 @@ exports.addTargetDependency = {
var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'],
pbxContainerItemProxySection = proj.hash.project.objects['PBXContainerItemProxy'],
target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target;
-
+
for (var index = 0; index < target.dependencies.length; index++) {
var dependency = target.dependencies[index].value,
targetProxy = pbxTargetDependencySection[dependency]['targetProxy'];
test.equal(pbxContainerItemProxySection[targetProxy]['containerPortal'], proj.hash.project['rootObject']);
}
-
+
test.done()
},
'should set each PBXContainerItemProxy`s proxyType correctly': function (test) {
var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'],
pbxContainerItemProxySection = proj.hash.project.objects['PBXContainerItemProxy'],
target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target;
-
+
for (var index = 0; index < target.dependencies.length; index++) {
var dependency = target.dependencies[index].value,
targetProxy = pbxTargetDependencySection[dependency]['targetProxy'];
test.equal(pbxContainerItemProxySection[targetProxy]['proxyType'], 1);
}
-
+
test.done()
}
}
diff --git a/test/addToPbxFileReferenceSection.js b/test/addToPbxFileReferenceSection.js
index 9ee10e6..d69abbc 100644
--- a/test/addToPbxFileReferenceSection.js
+++ b/test/addToPbxFileReferenceSection.js
@@ -34,7 +34,7 @@ exports['addToPbxFileReferenceSection function'] = {
'should add file and comment to fileReferenceSection': function (test) {
var file = new pbxFile('file.m');
file.fileRef = myProj.generateUuid();
-
+
myProj.addToPbxFileReferenceSection(file)
test.equal(myProj.pbxFileReferenceSection()[file.fileRef].isa, 'PBXFileReference');
@@ -58,7 +58,7 @@ exports['addToPbxFileReferenceSection function'] = {
},
'should add file with preset includeInIndex to fileReferenceSection correctly': function (test) {
var appexFile = { fileRef: myProj.generateUuid(), isa: 'PBXFileReference', includeInIndex: 0, path: "WatchKit Extension.appex"};
-
+
myProj.addToPbxFileReferenceSection(appexFile)
test.equal(myProj.pbxFileReferenceSection()[appexFile.fileRef].isa, 'PBXFileReference');
@@ -68,7 +68,7 @@ exports['addToPbxFileReferenceSection function'] = {
},
'should add file with preset sourceTree to fileReferenceSection correctly': function (test) {
var appexFile = { fileRef: myProj.generateUuid(), isa: 'PBXFileReference', sourceTree: 'BUILT_PRODUCTS_DIR', path: "WatchKit Extension.appex"};
-
+
myProj.addToPbxFileReferenceSection(appexFile)
test.equal(myProj.pbxFileReferenceSection()[appexFile.fileRef].isa, 'PBXFileReference');
diff --git a/test/addXCConfigurationList.js b/test/addXCConfigurationList.js
index d7d8dca..6ef74c3 100644
--- a/test/addXCConfigurationList.js
+++ b/test/addXCConfigurationList.js
@@ -31,7 +31,7 @@ var fullProject = require('./fixtures/full-project')
PRODUCT_NAME: '"${TARGET_NAME}"',
SKIP_INSTALL: 'YES'
},
- name: 'Debug'
+ name: 'Debug'
},
releaseConfiguration = {
isa: 'XCBuildConfiguration',
@@ -94,7 +94,7 @@ exports.addXCConfigurationList = {
pbxXCConfigurationListSection = myProj.pbxXCConfigurationList();
xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'),
xcConfigurationListInPbx = pbxXCConfigurationListSection[xcConfigurationList.uuid];
-
+
test.deepEqual(xcConfigurationListInPbx, xcConfigurationList.xcConfigurationList);
test.done();
},
@@ -111,7 +111,7 @@ exports.addXCConfigurationList = {
var configuration = xcConfigurationListConfigurations[index];
expectedConfigurations.push(pbxBuildConfigurationSection[configuration.value]);
}
-
+
test.deepEqual(expectedConfigurations, [debugConfiguration, releaseConfiguration]);
test.deepEqual(xcConfigurationListInPbx.buildConfigurations, xcConfigurationListConfigurations);
test.done();
@@ -126,7 +126,7 @@ exports.addXCConfigurationList = {
var configuration = xcConfigurationListConfigurations[index];
test.ok(pbxBuildConfigurationSection[configuration.value + '_comment']);
}
-
+
test.done();
}
}
diff --git a/test/multipleTargets.js b/test/multipleTargets.js
index 984ea90..dbb945f 100644
--- a/test/multipleTargets.js
+++ b/test/multipleTargets.js
@@ -36,14 +36,14 @@ exports.addFilesToTarget = {
var target = "1D6058900D05DD3D006BFB54";
var filename = "file.m";
- var opt = { target : target };
+ var opt = { target : target };
var newFile = proj.addSourceFile(filename,opt);
test.equal(newFile.constructor, pbxFile);
var sources = proj.pbxSourcesBuildPhaseObj(target);
test.equal(sources.files[5].comment, filename+" in Sources");
-
+
test.done();
},
'should remove the file from the proper target': function (test) {
@@ -51,7 +51,7 @@ exports.addFilesToTarget = {
var target = "1D6058900D05DD3D006BFB54";
var filename = "file.m";
- var opt = { target : target };
+ var opt = { target : target };
var newFile = proj.addSourceFile(filename,opt);
test.equal(newFile.constructor, pbxFile);
@@ -71,11 +71,11 @@ exports.addFilesToTarget = {
var target = "XXXXX";
var filename = "file.m";
- var opt = { target : target };
+ var opt = { target : target };
test.throws(function(){
proj.addSourceFile(filename,opt);
});
-
+
test.done();
},
@@ -84,14 +84,14 @@ exports.addFilesToTarget = {
var target = "1D6058900D05DD3D006BFB54";
var filename = "library.lib";
- var opt = { target : target };
+ var opt = { target : target };
var newFile = proj.addStaticLibrary(filename,opt);
test.equal(newFile.constructor, pbxFile);
var libraries = proj.pbxFrameworksBuildPhaseObj(target);
test.equal(libraries.files[4].comment, filename+" in Resources");
-
+
test.done();
},
'should remove the library to a proper target': function (test) {
@@ -99,7 +99,7 @@ exports.addFilesToTarget = {
var target = "1D6058900D05DD3D006BFB54";
var filename = "library.lib";
- var opt = { target : target };
+ var opt = { target : target };
var newFile = proj.addStaticLibrary(filename,opt);
test.equal(newFile.constructor, pbxFile);
@@ -113,21 +113,21 @@ exports.addFilesToTarget = {
test.equal(libraries.files.length,l-1);
test.done();
-
+
},
'should add the framework to a proper target': function (test) {
var target = "1D6058900D05DD3D006BFB54";
var filename = "delta.framework";
- var opt = { target : target };
+ var opt = { target : target };
var newFile = proj.addFramework(filename,opt);
test.equal(newFile.constructor, pbxFile);
var frameworks = proj.pbxFrameworksBuildPhaseObj(target);
test.equal(frameworks.files[4].comment, filename+" in Frameworks");
-
+
test.done();
},
'should add a ressource fileto a proper target': function (test) {
@@ -135,14 +135,14 @@ exports.addFilesToTarget = {
var target = "1D6058900D05DD3D006BFB54";
var filename = "delta.png";
- var opt = { target : target };
+ var opt = { target : target };
var newFile = proj.addResourceFile(filename,opt);
test.equal(newFile.constructor, pbxFile);
var resources = proj.pbxResourcesBuildPhaseObj(target);
test.equal(resources.files[26].comment, filename+" in Resources");
-
+
test.done();
},
'should remove a ressource file from a proper target': function (test) {
@@ -150,7 +150,7 @@ exports.addFilesToTarget = {
var target = "1D6058900D05DD3D006BFB54";
var filename = "delta.png";
- var opt = { target : target };
+ var opt = { target : target };
var newFile = proj.addResourceFile(filename,opt);
test.equal(newFile.constructor, pbxFile);
@@ -163,7 +163,7 @@ exports.addFilesToTarget = {
proj.removeResourceFile(filename,opt);
var resources = proj.pbxResourcesBuildPhaseObj(target);
test.equal(resources.files.length,l-1);
-
+
test.done();
},
}
diff --git a/test/pbxItemByComment.js b/test/pbxItemByComment.js
index 6400404..5bee287 100644
--- a/test/pbxItemByComment.js
+++ b/test/pbxItemByComment.js
@@ -39,28 +39,28 @@ exports.pbxItemByComment = {
},
'should return PBXContainerItemProxy': function (test) {
var pbxItem = proj.pbxItemByComment('libPhoneGap.a', 'PBXReferenceProxy');
-
+
test.ok(pbxItem);
test.equals(pbxItem.isa, 'PBXReferenceProxy');
test.done()
},
'should return PBXResourcesBuildPhase': function (test) {
var pbxItem = proj.pbxItemByComment('Resources', 'PBXResourcesBuildPhase');
-
+
test.ok(pbxItem);
test.equals(pbxItem.isa, 'PBXResourcesBuildPhase');
test.done()
},
'should return PBXShellScriptBuildPhase': function (test) {
var pbxItem = proj.pbxItemByComment('Touch www folder', 'PBXShellScriptBuildPhase');
-
+
test.ok(pbxItem);
test.equals(pbxItem.isa, 'PBXShellScriptBuildPhase');
test.done()
},
'should return null when PBXNativeTarget not found': function (test) {
var pbxItem = proj.pbxItemByComment('Invalid', 'PBXTargetDependency');
-
+
test.equal(pbxItem, null);
test.done()
}
diff --git a/test/pbxProject.js b/test/pbxProject.js
index 6b3a238..c076b96 100644
--- a/test/pbxProject.js
+++ b/test/pbxProject.js
@@ -51,7 +51,7 @@ exports['parseSync function'] = {
test.equal(projHash.hash.project.archiveVersion, 1);
test.equal(projHash.hash.project.objectVersion, 45);
test.equal(projHash.hash.project.nonObject, '29B97313FDCFA39411CA2CEF');
-
+
test.done();
},
}
diff --git a/test/pbxTargetByName.js b/test/pbxTargetByName.js
index 0949965..15c956d 100644
--- a/test/pbxTargetByName.js
+++ b/test/pbxTargetByName.js
@@ -32,14 +32,14 @@ exports.setUp = function (callback) {
exports.pbxTargetByName = {
'should return PBXNativeTarget': function (test) {
var pbxTarget = proj.pbxTargetByName('KitchenSinktablet');
-
+
test.ok(pbxTarget);
test.equals(pbxTarget.isa, 'PBXNativeTarget');
test.done()
},
'should return null when PBXNativeTarget not found': function (test) {
var pbxTarget = proj.pbxTargetByName('Invalid');
-
+
test.equal(pbxTarget, null);
test.done()
}
diff --git a/test/removeHeaderFile.js b/test/removeHeaderFile.js
index 9a18850..acda161 100644
--- a/test/removeHeaderFile.js
+++ b/test/removeHeaderFile.js
@@ -35,22 +35,22 @@ exports.removeHeaderFile = {
var newFile = proj.addHeaderFile('file.h');
test.equal(newFile.constructor, pbxFile);
-
+
var deletedFile = proj.removeHeaderFile('file.h');
-
+
test.equal(deletedFile.constructor, pbxFile);
-
+
test.done()
},
'should set a fileRef on the pbxFile': function (test) {
var newFile = proj.addHeaderFile('file.h');
test.ok(newFile.fileRef);
-
+
var deletedFile = proj.removeHeaderFile('file.h');
-
+
test.ok(deletedFile.fileRef);
-
+
test.done()
},
'should remove 2 fields from the PBXFileReference section': function (test) {
@@ -61,7 +61,7 @@ exports.removeHeaderFile = {
test.equal(68, frsLength);
test.ok(fileRefSection[newFile.fileRef]);
test.ok(fileRefSection[newFile.fileRef + '_comment']);
-
+
var deletedFile = proj.removeHeaderFile('file.h'),
fileRefSection = proj.pbxFileReferenceSection(),
frsLength = Object.keys(fileRefSection).length;
@@ -78,12 +78,12 @@ exports.removeHeaderFile = {
commentKey = newFile.fileRef + '_comment';
test.equal(fileRefSection[commentKey], 'file.h');
-
+
var deletedFile = proj.removeHeaderFile('file.h'),
fileRefSection = proj.pbxFileReferenceSection(),
commentKey = deletedFile.fileRef + '_comment';
test.ok(!fileRefSection[commentKey]);
-
+
test.done();
},
'should remove the PBXFileReference object correctly': function (test) {
@@ -97,7 +97,7 @@ exports.removeHeaderFile = {
test.equal(fileRefEntry.name, '"file.h"');
test.equal(fileRefEntry.path, '"file.h"');
test.equal(fileRefEntry.sourceTree, '"<group>"');
-
+
var deletedFile = proj.removeHeaderFile('Plugins/file.h'),
fileRefSection = proj.pbxFileReferenceSection(),
fileRefEntry = fileRefSection[deletedFile.fileRef];
@@ -111,12 +111,12 @@ exports.removeHeaderFile = {
plugins = proj.pbxGroupByName('Plugins');
test.equal(plugins.children.length, 1);
-
+
var deletedFile = proj.removeHeaderFile('Plugins/file.h'),
plugins = proj.pbxGroupByName('Plugins');
test.equal(plugins.children.length, 0);
-
+
test.done();
}
}
diff --git a/test/removeResourceFile.js b/test/removeResourceFile.js
index e54cdb8..bda48f9 100644
--- a/test/removeResourceFile.js
+++ b/test/removeResourceFile.js
@@ -35,7 +35,7 @@ exports.removeResourceFile = {
var newFile = proj.addResourceFile('assets.bundle');
test.equal(newFile.constructor, pbxFile);
-
+
var deletedFile = proj.removeResourceFile('assets.bundle');
test.equal(deletedFile.constructor, pbxFile);
@@ -46,22 +46,22 @@ exports.removeResourceFile = {
var newFile = proj.addResourceFile('assets.bundle');
test.ok(newFile.uuid);
-
+
var deletedFile = proj.removeResourceFile('assets.bundle');
-
+
test.ok(deletedFile.uuid);
-
+
test.done()
},
'should set a fileRef on the pbxFile': function (test) {
var newFile = proj.addResourceFile('assets.bundle');
test.ok(newFile.fileRef);
-
+
var deletedFile = proj.removeResourceFile('assets.bundle');
test.ok(deletedFile.fileRef);
-
+
test.done()
},
'should remove 2 fields from the PBXBuildFile section': function (test) {
@@ -80,7 +80,7 @@ exports.removeResourceFile = {
test.equal(58, bfsLength);
test.ok(!buildFileSection[deletedFile.uuid]);
test.ok(!buildFileSection[deletedFile.uuid + '_comment']);
-
+
test.done();
},
'should remove the PBXBuildFile comment correctly': function (test) {
@@ -89,13 +89,13 @@ exports.removeResourceFile = {
buildFileSection = proj.pbxBuildFileSection();
test.equal(buildFileSection[commentKey], 'assets.bundle in Resources');
-
+
var deletedFile = proj.removeResourceFile('assets.bundle'),
commentKey = deletedFile.uuid + '_comment',
buildFileSection = proj.pbxBuildFileSection();
test.ok(!buildFileSection[commentKey]);
-
+
test.done();
},
'should remove the PBXBuildFile object correctly': function (test) {
@@ -112,7 +112,7 @@ exports.removeResourceFile = {
buildFileEntry = buildFileSection[deletedFile.uuid];
test.ok(!buildFileEntry);
-
+
test.done();
},
'should remove 2 fields from the PBXFileReference section': function (test) {
@@ -140,7 +140,7 @@ exports.removeResourceFile = {
commentKey = newFile.fileRef + '_comment';
test.equal(fileRefSection[commentKey], 'assets.bundle');
-
+
var deletedFile = proj.removeResourceFile('assets.bundle'),
fileRefSection = proj.pbxFileReferenceSection(),
commentKey = deletedFile.fileRef + '_comment';
@@ -175,7 +175,7 @@ exports.removeResourceFile = {
resources = proj.pbxGroupByName('Resources');
test.equal(resources.children.length, 10);
-
+
var deletedFile = proj.removeResourceFile('Resources/assets.bundle'),
resources = proj.pbxGroupByName('Resources');
@@ -187,7 +187,7 @@ exports.removeResourceFile = {
sources = proj.pbxResourcesBuildPhaseObj();
test.equal(sources.files.length, 13);
-
+
var deletedFile = proj.removeResourceFile('Resources/assets.bundle'),
sources = proj.pbxResourcesBuildPhaseObj();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org