Sha256: 22eeb7907eb87650a6568eaef5beb25ba7512d1ebe5f96e4ce69a629bda4a3f5

Contents?: true

Size: 1.31 KB

Versions: 2

Compression:

Stored size: 1.31 KB

Contents

'use strict';
var storable;

storable = require('indemma/lib/record/storable.js');

describe('storable', function() {
  it('should set the storable key', function() {
    return model.should.have.property('storable', true);
  });
  beforeEach(function() {
    return this.storage = storable();
  });
  return describe("#store", function() {
    beforeEach(function() {
      return this.data = {
        name: 'Arthur Dent'
      };
    });
    describe("write", function() {
      it("should write object on deep storage");
      it("should write object on storage", function() {
        this.storage.store('1', this.data);
        this.storage.writes.should.be.eq(1);
        return this.storage.database['1'].should.be.eq(this.data);
      });
      return it("should mark an object as sustained", function() {
        this.storage.store('1', this.data);
        return this.data.should.have.property('sustained', true);
      });
    });
    return describe("read", function() {
      beforeEach(function() {
        this.data = {
          name: 'Arthur Dent'
        };
        return this.storage.store('1', this.data);
      });
      it("should save object on storage", function() {
        return this.storage.store('1').should.be.eq(this.data);
      });
      return it("should unmark an object as sustained");
    });
  });
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ende-0.5.22 components/indefinido/indemma/master/spec/record/storable_spec.js
ende-0.5.21 components/indefinido/indemma/master/spec/record/storable_spec.js