Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing whitespace from test/*.js #34

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions test/addBuildPhase.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
},
Expand All @@ -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) {
Expand All @@ -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();
},
Expand All @@ -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();
Expand All @@ -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();
},
Expand All @@ -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();
},
Expand All @@ -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();
},
Expand Down
2 changes: 1 addition & 1 deletion test/addHeaderFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
28 changes: 14 additions & 14 deletions test/addRemovePbxGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
},
Expand All @@ -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) {
Expand All @@ -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);
Expand All @@ -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();
},
Expand All @@ -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();
},
Expand All @@ -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();
Expand All @@ -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();
},
Expand All @@ -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();
},
Expand All @@ -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();
},
Expand All @@ -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();
Expand All @@ -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()
}
Expand Down
8 changes: 4 additions & 4 deletions test/addResourceFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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 }));
Expand Down
2 changes: 1 addition & 1 deletion test/addSourceFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions test/addStaticLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }));
Expand Down
21 changes: 10 additions & 11 deletions test/addTarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -63,30 +63,30 @@ 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),
resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid),
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);
Expand All @@ -99,8 +99,7 @@ exports.addTarget = {
test.ok(target.pbxNativeTarget.buildPhases);
test.ok(target.pbxNativeTarget.buildRules);
test.ok(target.pbxNativeTarget.dependencies);

test.done();

}
}
}
Loading