Skip to content

Commit f145205

Browse files
author
Anis Kadri
committed
adding test for updateBuildProperty
1 parent 5562020 commit f145205

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/pbxProject.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,25 @@ exports['updateProductName function'] = {
155155
}
156156
}
157157

158+
exports['updateBuildProperty function'] = {
159+
setUp:function(callback) {
160+
callback();
161+
},
162+
tearDown:function(callback) {
163+
fs.writeFileSync(bcpbx, original_pbx, 'utf-8');
164+
callback();
165+
},
166+
'should change build properties in the .pbxproj file': function (test) {
167+
var myProj = new pbx('test/parser/projects/build-config.pbxproj');
168+
myProj.parse(function(err, hash) {
169+
myProj.updateBuildProperty('TARGETED_DEVICE_FAMILY', '"arm"');
170+
var newContents = myProj.writeSync();
171+
test.ok(newContents.match(/TARGETED_DEVICE_FAMILY\s*=\s*"arm"/));
172+
test.done();
173+
});
174+
}
175+
}
176+
158177
exports['productName field'] = {
159178
'should return the product name': function (test) {
160179
var newProj = new pbx('.');

0 commit comments

Comments
 (0)