|
| 1 | +var PEG = require('pegjs'), |
| 2 | + fs = require('fs'), |
| 3 | + pbx = fs.readFileSync('test/parser/projects/section-split.pbxproj', 'utf-8'), |
| 4 | + grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'), |
| 5 | + parser = PEG.buildParser(grammar), |
| 6 | + rawProj = parser.parse(pbx), |
| 7 | + project = rawProj.project; |
| 8 | + |
| 9 | +exports['should have a PBXTargetDependency section'] = function (test) { |
| 10 | + test.ok(project.objects['PBXTargetDependency']); |
| 11 | + test.done(); |
| 12 | +} |
| 13 | + |
| 14 | +exports['should have the right child of PBXTargetDependency section'] = function (test) { |
| 15 | + test.ok(project.objects['PBXTargetDependency']['301BF551109A68C00062928A']); |
| 16 | + test.done(); |
| 17 | +} |
| 18 | + |
| 19 | +exports['should have the right properties on the dependency'] = function (test) { |
| 20 | + var dependency = project.objects['PBXTargetDependency']['301BF551109A68C00062928A']; |
| 21 | + |
| 22 | + test.equal(dependency.isa, 'PBXTargetDependency') |
| 23 | + test.equal(dependency.name, 'PhoneGapLib') |
| 24 | + test.equal(dependency.targetProxy, '301BF550109A68C00062928A') |
| 25 | + test.equal(dependency['targetProxy_comment'], 'PBXContainerItemProxy') |
| 26 | + |
| 27 | + test.done(); |
| 28 | +} |
| 29 | + |
| 30 | +exports['should merge two PBXTargetDependency sections'] = function (test) { |
| 31 | + test.ok(project.objects['PBXTargetDependency']['301BF551109A68C00062928A']); |
| 32 | + test.ok(project.objects['PBXTargetDependency']['45FDD1944D304A9F96DF3AC6']); |
| 33 | + test.done(); |
| 34 | +} |
| 35 | + |
0 commit comments