var mf = require('../');
var override = mf.override;
var restore = mf.restore;
var should = require('should');

describe('override', function() {
  it('should return a function', function() {
    var fun = function() {}
    var obj = {
      prop: fun,
    };
    override(obj, 'prop', function() {}).should.be.an.instanceOf(Function);
  });
  it('should return a function that overrides the given function', function() {
    var fun = function() {}
    var obj = {
      prop: fun,
    };
    var mock = function() {};
    override(obj, 'prop', mock)();
    obj.prop.should.not.equal(fun);
  });
  describe('overridden function', function() {
    it('should have called property');
    it('should have calledTimes property');
    it('should update called property if function is called');
    it('should update calledTimes property if function is called');
    it('should not call the original function');
    it('should call the override function');
  });
});

describe('restore', function() {
  it('should restore the overridden function', function() {
  });
});

@@ -645,84 +645,544 @@
     
-it('should have called property');%0A    it('should have calledTimes property'
+var obj, called, ocalled;%0A    var mock = function() %7B called = true; %7D%0A    beforeEach(function() %7B%0A      called = false;%0A      ocalled = false;%0A      var o = %7B%0A        p: function() %7B ocalled = true; %7D%0A      %7D;%0A      override(o, 'p', mock)();%0A      obj = o;%0A    %7D);%0A    it('should have called property', function() %7B%0A      should.exist(obj.p.called);%0A      obj.p.called.should.be.false;%0A    %7D);%0A    it('should have calledTimes property', function() %7B%0A      should.exist(obj.p.calledTimes);%0A      obj.p.calledTimes.should.equal(0);%0A    %7D
 );%0A 

Test mock properties