<commit_before>
var removetask = require('../remove'),
    path = require('path'),
    fs = require('fs'),
    ajgenesis = require('ajgenesis'),
    fsutils = require('./lib/fsutils');
    
exports['remove project'] = function (test) {
    test.async();
    
    var cwd = process.cwd();
    fsutils.removeDirSync(path.join(__dirname, 'models'));
    process.chdir('test');
    ajgenesis.createDirectory('models');
    
    var filename = path.resolve(path.join(__dirname, 'models', 'project1.json'));
    fs.writeFileSync(filename, '{ "project1": true }');
    
    removetask(null, ['project1'], ajgenesis, function (err) {
        if (err)
            throw err;
        
        test.ok(!fs.existsSync(filename));
        fsutils.removeDirSync(path.join(__dirname, 'models'));
            
        test.done();
    });
    
    process.chdir(cwd);
}
    
exports['remove project property'] = function (test) {
    test.async();
    
    var cwd = process.cwd();
    fsutils.removeDirSync(path.join(__dirname, 'models'));
    process.chdir('test');
    ajgenesis.createDirectory('models');
    
    var filename = path.resolve(path.join(__dirname, 'models', 'project2.json'));
    fs.writeFileSync(filename, '{ "project2": { "name": "myproject", "title": "My Project" } }');
    
    removetask(null, ['project2', 'title'], ajgenesis, function (err) {
        if (err)
            throw err;
        
        test.ok(fs.existsSync(filename));
        var text = fs.readFileSync(filename).toString();
        eval("var model = " + text);
        
        test.ok(model);
        test.ok(model.project2);
        test.ok(model.project2.name);
        test.equal(model.project2.name, "myproject");
        test.strictEqual(model.project2.title, undefined);
        
        fsutils.removeDirSync(path.join(__dirname, 'models'));
            
        test.done();
    });
    
    process.chdir(cwd);
}<commit_msg>Remove properties, use modeln in remove test<commit_after>
var removetask = require('../remove'),
    path = require('path'),
    fs = require('fs'),
    ajgenesis = require('ajgenesis'),
    fsutils = require('./lib/fsutils');
    
exports['remove model'] = function (test) {
    test.async();
    
    var cwd = process.cwd();
    fsutils.removeDirSync(path.join(__dirname, 'models'));
    process.chdir('test');
    ajgenesis.createDirectory('models');
    
    var filename = path.resolve(path.join(__dirname, 'models', 'model1.json'));
    fs.writeFileSync(filename, '{ "model1": true }');
    
    removetask(null, ['model1'], ajgenesis, function (err) {
        if (err)
            throw err;
        
        test.ok(!fs.existsSync(filename));
        fsutils.removeDirSync(path.join(__dirname, 'models'));
            
        test.done();
    });
    
    process.chdir(cwd);
}
    
exports['remove model property'] = function (test) {
    test.async();
    
    var cwd = process.cwd();
    fsutils.removeDirSync(path.join(__dirname, 'models'));
    process.chdir('test');
    ajgenesis.createDirectory('models');
    
    var filename = path.resolve(path.join(__dirname, 'models', 'model2.json'));
    fs.writeFileSync(filename, '{ "model2": { "name": "myproject", "title": "My Project" } }');
    
    removetask(null, ['model2', 'title'], ajgenesis, function (err) {
        if (err)
            throw err;
        
        test.ok(fs.existsSync(filename));
        var text = fs.readFileSync(filename).toString();
        eval("var model = " + text);
        
        test.ok(model);
        test.ok(model.model2);
        test.ok(model.model2.name);
        test.equal(model.model2.name, "myproject");
        test.strictEqual(model.model2.title, undefined);
        
        fsutils.removeDirSync(path.join(__dirname, 'models'));
            
        test.done();
    });
    
    process.chdir(cwd);
}
    
exports['remove model properties'] = function (test) {
    test.async();
    
    var cwd = process.cwd();
    fsutils.removeDirSync(path.join(__dirname, 'models'));
    process.chdir('test');
    ajgenesis.createDirectory('models');
    
    var filename = path.resolve(path.join(__dirname, 'models', 'model3.json'));
    fs.writeFileSync(filename, '{ "model3": { "name": "myproject", "title": "My Project", "notes": "My notes" } }');
    
    removetask(null, ['model3', 'title', 'notes'], ajgenesis, function (err) {
        if (err)
            throw err;
        
        test.ok(fs.existsSync(filename));
        var text = fs.readFileSync(filename).toString();
        eval("var model = " + text);
        
        test.ok(model);
        test.ok(model.model3);
        test.ok(model.model3.name);
        test.equal(model.model3.name, "myproject");
        test.strictEqual(model.model3.title, undefined);
        test.strictEqual(model.model3.notes, undefined);
        
        fsutils.removeDirSync(path.join(__dirname, 'models'));
            
        test.done();
    });
    
    process.chdir(cwd);
}
{'fraction_non_alphanumeric': 0.16713766653209527, 'fraction_numerical': 0.005651998385143318, 'mean_word_length': 2.5673146148308135, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2432014', 'n_tokens_mistral': 1537, 'n_tokens_neox': 1519, 'n_words': 263}