Skip to content

Commit 272453a

Browse files
committed
[test] tests for delimited sections
1 parent b0758fb commit 272453a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/section.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
var PEG = require('pegjs'),
2+
fs = require('fs'),
3+
pbx = fs.readFileSync('test/projects/section.pbxproj', 'utf-8'),
4+
grammar = fs.readFileSync('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+
}

0 commit comments

Comments
 (0)