<commit_before>var should = require('should');
var should = require('should');
var uuid = require("node-uuid").v4;
var Promise = require("bluebird");

var Store = require('../lib/persistence/inmemory/inmemory_persistence');
var Commit = require('../lib/persistence/commit');
var Event = require('../lib/event');
var PersistenceConcurrencyError = require('../lib/persistence/concurrency_error');
var PersistenceDuplicateCommitError = require('../lib/persistence/duplicate_commit_error');

describe('inmemory_persistence', function() {
	describe('#commit', function() {

		it('should accept a commit and store it', function(done) {
			var store = new Store();
			store.openPartition('1').then(function(partition)
				{
					var events = [new Event(uuid(), 'type1',{test:11})];
					var commit = new Commit(uuid(), 'master', '1', 0, events);
					partition.append(commit).then(function(){return partition.queryAll()}).then(function(x){
						x.length.should.equal(1);
						done();
					}).catch(function(err) {
						done(err);
					});
				});
		});

		it('commit in one stream is not visible in other', function(done) {<commit_msg>fixed paths in test<commit_after>var should = require('should');
var uuid = require("node-uuid").v4;
var Promise = require("bluebird");

var Store = require('../../lib/persistence/inmemory/inmemory_persistence');
var Commit = require('../../lib/persistence/commit');
var Event = require('../../lib/event');
var PersistenceConcurrencyError = require('../../lib/persistence/concurrency_error');
var PersistenceDuplicateCommitError = require('../../lib/persistence/duplicate_commit_error');

describe('inmemory_persistence', function() {
	describe('#commit', function() {

		it('should accept a commit and store it', function(done) {
			var store = new Store();
			store.openPartition('1').then(function(partition)
				{
					var events = [new Event(uuid(), 'type1',{test:11})];
					var commit = new Commit(uuid(), 'master', '1', 0, events);
					partition.append(commit).then(function(){return partition.queryAll()}).then(function(x){
						x.length.should.equal(1);
						done();
					}).catch(function(err) {
						done(err);
					});
				});
		});

		it('commit in one stream is not visible in other', function(done) {
{'fraction_non_alphanumeric': 0.18347401155042203, 'fraction_numerical': 0.007107952021323856, 'mean_word_length': 4.479318734793187, 'pattern_counts': {'":': 0, '<': 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': '898807', 'n_tokens_mistral': 748, 'n_tokens_neox': 655, 'n_words': 146}