enieber
7/11/2016 - 4:47 PM

Style Tests

Style Tests

'use strict';

function Calc() { }

Calc.prototype.sum = function(n1, n2){
  return n1 + n2;
}
describe('Calc', function(){
  var subject, result;
  
  beforeEach(function(){
    subject = new Calc();
  });
  
  describe('#sum', function(){
    beforeEach(function(){
      result = subject(3, 5);
    });
    
    it('sums two numbers', function(){
      expect(result).toEqual(8);
    });
  });
});