|
| 1 | +var pbxFile = require('../lib/pbxFile'); |
| 2 | + |
| 3 | +exports['lastType'] = { |
| 4 | + 'should detect that a .m path means sourcecode.c.objc': function (test) { |
| 5 | + var sourceFile = new pbxFile('Plugins/ChildBrowser.m'); |
| 6 | + |
| 7 | + test.equal('sourcecode.c.objc', sourceFile.lastType); |
| 8 | + test.done(); |
| 9 | + }, |
| 10 | + |
| 11 | + 'should detect that a .h path means sourceFile.c.h': function (test) { |
| 12 | + var sourceFile = new pbxFile('Plugins/ChildBrowser.h'); |
| 13 | + |
| 14 | + test.equal('sourcecode.c.h', sourceFile.lastType); |
| 15 | + test.done(); |
| 16 | + }, |
| 17 | + |
| 18 | + 'should detect that a .bundle path means "wrapper.plug-in"': function (test) { |
| 19 | + var sourceFile = new pbxFile('Plugins/ChildBrowser.bundle'); |
| 20 | + |
| 21 | + test.equal('"wrapper.plug-in"', sourceFile.lastType); |
| 22 | + test.done(); |
| 23 | + }, |
| 24 | + |
| 25 | + 'should detect that a .xib path means file.xib': function (test) { |
| 26 | + var sourceFile = new pbxFile('Plugins/ChildBrowser.xib'); |
| 27 | + |
| 28 | + test.equal('file.xib', sourceFile.lastType); |
| 29 | + test.done(); |
| 30 | + }, |
| 31 | + |
| 32 | + 'should allow lastType to be overridden': function (test) { |
| 33 | + var sourceFile = new pbxFile('Plugins/ChildBrowser.m', |
| 34 | + { lastType: 'somestupidtype' }); |
| 35 | + |
| 36 | + test.equal('somestupidtype', sourceFile.lastType); |
| 37 | + test.done(); |
| 38 | + }, |
| 39 | + |
| 40 | + 'should set lastType to unknown if undetectable': function (test) { |
| 41 | + var sourceFile = new pbxFile('Plugins/ChildBrowser.guh'); |
| 42 | + |
| 43 | + test.equal('unknown', sourceFile.lastType); |
| 44 | + test.done(); |
| 45 | + } |
| 46 | +} |
| 47 | + |
| 48 | +exports['group'] = { |
| 49 | + 'should be Sources for source files': function (test) { |
| 50 | + var sourceFile = new pbxFile('Plugins/ChildBrowser.m'); |
| 51 | + |
| 52 | + test.equal('Sources', sourceFile.group); |
| 53 | + test.done(); |
| 54 | + }, |
| 55 | + 'should be Resources for all other files': function (test) { |
| 56 | + var headerFile = new pbxFile('Plugins/ChildBrowser.h'), |
| 57 | + xibFile = new pbxFile('Plugins/ChildBrowser.xib'); |
| 58 | + |
| 59 | + test.equal('Resources', headerFile.group); |
| 60 | + test.equal('Resources', xibFile.group); |
| 61 | + test.done(); |
| 62 | + } |
| 63 | +} |
0 commit comments