UNPKG

dl

Version:

DreamLab Libs

48 lines (41 loc) 1.25 kB
/*jslint node: true */ 'use strict'; var Batch = require('../../lib/nosqldb/Batch.js').Batch; describe('Batch', function() { beforeEach(function () { this.batch = new Batch(); }); describe('insert', function() { it('should be added to batch', function() { this.batch.insert('test', 'key', {'column': 'value'}); expect(this.batch.operations).toEqual([ { name: 'insert', params: { table: 'test', key: 'key', columns: { 'column': 'value' }, ttl: null } } ]); }); }); describe('remove', function() { it('should be added to batch', function() { this.batch.remove('test', 'key'); expect(this.batch.operations).toEqual([ { name: 'remove', params: { table: 'test', key: 'key', columns: null } } ]); }); }); });