// Generated by CoffeeScript 1.6.3
(function() {
  var Cache, DevNullStorage, cache, expect;

  expect = require('chai').expect;

  Cache = require('../../../../../lib/Cache');

  DevNullStorage = require('../../../../../Storage/DevNullAsyncStorage');

  cache = null;

  describe('DevNullAsyncStorage', function() {
    return describe('saving/loading', function() {
      beforeEach(function() {
        return cache = new Cache(new DevNullStorage, 'test');
      });
      it('should not save true', function(done) {
        return cache.save('true', true, function() {
          return cache.load('true', function(err, data) {
            expect(data).to.be["null"];
            return done();
          });
        });
      });
      it('should always return null', function(done) {
        return cache.load('true', function(err, data) {
          expect(data).to.be["null"];
          return done();
        });
      });
      it('should not save true and try to delete it', function(done) {
        return cache.save('true', true, function() {
          return cache.remove('true', function() {
            return cache.load('true', function(err, data) {
              expect(data).to.be["null"];
              return done();
            });
          });
        });
      });
      return it('should not save true to cache from fallback function in load', function(done) {
        return cache.load('true', function() {
          return true;
        }, function(err, data) {
          expect(data).to.be["true"];
          return cache.load('true', function(err, data) {
            expect(data).to.be["null"];
            return done();
          });
        });
      });
    });
  });

}).call(this);
