Last active
August 29, 2015 14:25
-
-
Save delacruz-dev/188830bec2e430daed08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import expect from 'expect'; | |
import {isMultipleOfFive, getMultiplesOfFive, getSumOfMultiples, sum} from '../src' | |
describe('Given a number', function(){ | |
it('return true if it is a multiple of 5', function(){ | |
expect(isMultipleOfFive(5)).toBe(true); | |
expect(isMultipleOfFive(10)).toBe(true); | |
expect(isMultipleOfFive(1)).toBe(false); | |
expect(isMultipleOfFive(9)).toBe(false); | |
}); | |
}); | |
describe('Given two numbers', function(){ | |
it('Gets all the multiples of five between them', function(){ | |
expect(getMultiplesOfFive(1, 5)).toInclude(5); | |
expect(getMultiplesOfFive(1, 10)).toInclude(5).toInclude(10); | |
}); | |
it('Gets the sum of both numbers', function() { | |
expect(sum(1, 1)).toBe(2); | |
expect(sum(5, 10)).toBe(15); | |
}); | |
it('Gets the sum of all the multiples of five between them', function(){ | |
expect(getSumOfMultiples(1, 5)).toBe(5); | |
expect(getSumOfMultiples(1, 10)).toBe(15); | |
expect(getSumOfMultiples(1, 20)).toBe(50); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment