'use strict';

import EventMap from 'eventmap';
import Model from 'flockn/model';

describe('flockn/model', function () {

  it('is a function', function () {
    expect(Model).to.be.a('function');
  });

  describe('constructor', function () {
    it('can be instantiated', function () {
      var model = new Model();

      expect(model).to.be.a('object');
      expect(model).to.be.an.instanceOf(Model);
    });

    it('inherits from EventMap', function() {
      var model = new Model();

      expect(model).to.be.an.instanceOf(EventMap);
    });
  });

  describe('#get', function() {
    it('undefined when there is no valid property', function() {
      var model = new Model();
      var test = model.get('test');

      expect(test).to.be(undefined);
    });

    it('exact property value', function() {
      var model = new Model();
      model.set('test', 5);
      var test = model.get('test');

      expect(test).to.be(5);
    });
  });

});

@@ -582,24 +582,54 @@
 unction() %7B%0A
+    var model = new Model();%0A%0A
     it('unde
@@ -685,39 +685,8 @@
 ) %7B%0A
-      var model = new Model();%0A
     
@@ -812,39 +812,8 @@
 ) %7B%0A
-      var model = new Model();%0A
     
@@ -865,32 +865,32 @@
 l.get('test');%0A%0A
-
       expect(tes
@@ -917,12 +917,407 @@
 %0A  %7D);%0A%0A
+  describe('#set', function() %7B%0A    var model = new Model();%0A%0A    it('gets correctly set', function() %7B%0A      model.set('test', 8);%0A      var test = model.get('test');%0A%0A      expect(test).to.be(8);%0A    %7D);%0A%0A    it('overwrites previous value', function() %7B%0A      model.set('test', 8);%0A      model.set('test', 12);%0A      var test = model.get('test');%0A%0A      expect(test).to.be(12);%0A    %7D);%0A  %7D);%0A%0A
 %7D);%0A

Update model