var expect = require("chai").expect;

var copyrightHelper = require('../helpers/modules/copyright');

describe('copyright', function() {

    'use strict';

    describe('Arguments validation', function() {

        it('should throw TypeError if startYear argument is not an integer', function() {
            var err = new TypeError('startYear must be an integer');
            expect(copyrightHelper.getCopyright.bind('2019', 2023)).to.throw(TypeError);
        });

        it('should throw TypeError if currentYear argument is not an integer', function() {
            var err = new TypeError('currentYear must be an integer');
            expect(copyrightHelper.getCopyright.bind(2017, '2019')).to.throw(TypeError);
        });

        it('should throw RangeError if currentYear argument is less than startYear', function() {
            var err = new TypeError('startYear must be equal to or less than currentYear');
            expect(copyrightHelper.getCopyright.bind(2020, 2028)).to.throw(TypeError);
        });

    });

    describe('Return values', function() {

        it('should return correct text if startYear is equal to currentYear', function() {
            var startYear = 2018,
                currentYear = 2018,
                text = `${currentYear}`;

            var copyright = copyrightHelper.getCopyright(startYear, currentYear);

            expect(copyright).to.equal(text);
        });

        it('should return correct text if startYear is less than currentYear', function() {
            var startYear = 2014,
                currentYear = 2020,
                text = `${startYear} - ${currentYear}`;

            var copyright = copyrightHelper.getCopyright(startYear, currentYear);

            expect(copyright).to.equal(text);
        });

    });

});
@@ -311,61 +311,29 @@
 var 
-err = new TypeError('startYear must be an integer');%0A
+fn = function()%7B%0A    
     
@@ -332,39 +332,32 @@
                 
-expect(
 copyrightHelper.
@@ -368,21 +368,16 @@
 opyright
-.bind
 ('2019',
@@ -382,36 +382,107 @@
 ', 2023)
-).to.throw(TypeError
+;%0A            %7D;%0A%0A            expect(fn).to.throw(TypeError, 'startYear must be an integer'
 );%0A     
@@ -601,62 +601,24 @@
 var 
-err = new TypeError('currentYear must be an integer');
+fn = function()%7B
 %0A   
@@ -618,39 +618,36 @@
 ()%7B%0A            
-expect(
+    
 copyrightHelper.
@@ -658,21 +658,16 @@
 opyright
-.bind
 (2017, '
@@ -672,36 +672,109 @@
  '2019')
-).to.throw(TypeError
+;%0A            %7D;%0A%0A            expect(fn).to.throw(TypeError, 'currentYear must be an integer'
 );%0A     
@@ -899,84 +899,29 @@
 var 
-err = new TypeError('startYear must be equal to or less than currentYear');%0A
+fn = function()%7B%0A    
     
@@ -920,39 +920,32 @@
                 
-expect(
 copyrightHelper.
@@ -960,25 +960,59 @@
 ight
-.bind
 (202
-0
+8
 , 202
-8)
+0);%0A            %7D;%0A%0A            expect(fn
 ).to
@@ -1022,20 +1022,77 @@
 row(
-Typ
+Rang
 eError
+, 'startYear must be equal to or less than currentYear'
 );%0A
+%0A
     

Fix copyright module tests