pbxproj
Version:
parse & stringify xcode pbxproj format
67 lines (50 loc) • 1.81 kB
JavaScript
var _ = require('lodash');
var assert = require('assert');
var CommentStage = require('../lib/stage/comment');
describe('CommentStage', function () {
it('should call expectedError when first caracter is not "/"', function (done) {
var ctx = {};
var stage = new CommentStage(ctx, '<', 0, 0);
stage.expectedError = _.partial(done, null);
stage.run();
});
it('should call expectedError when second caracter is not "/" or "*"', function (done) {
var ctx = {};
var stage = new CommentStage(ctx, '/=', 0, 0);
stage.expectedError = _.partial(done, null);
stage.run();
});
it('should call feedInline when // is found', function (done) {
var ctx = {};
var stage = new CommentStage(ctx, '//', 0, 0);
stage.expectedError = _.noop;
stage.feedInline = _.partial(done, null);
stage.run();
});
it('should call closeInline when \n is found', function (done) {
var ctx = {};
var stage = new CommentStage(ctx, '// my comment\n', 0, 0);
stage.closeInline = _.partial(done, null);
stage.run();
});
it('should call feedBlock when /* is found', function (done) {
var ctx = {};
var stage = new CommentStage(ctx, '/*', 0, 0);
stage.expectedError = _.noop;
stage.feedBlock = _.partial(done, null);
stage.run();
});
it('should call beginCloseBlock when * is found', function (done) {
var ctx = {};
var stage = new CommentStage(ctx, '/* my comment *', 0, 0);
stage.expectedError = _.noop;
stage.beginCloseBlock = _.partial(done, null);
stage.run();
});
it('should call endCloseBlock when */ is found', function (done) {
var ctx = {};
var stage = new CommentStage(ctx, '/* my comment */', 0, 0);
stage.endCloseBlock = _.partial(done, null);
stage.run();
});
});