Last active
October 28, 2016 18:43
-
-
Save Kuz-man/1ad24e5c6e0bebdcdb7ccfdd3b88c41f to your computer and use it in GitHub Desktop.
Challenge 3
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
describe '#fibonacci_like?' do | |
it { expect(fibonacci_like?([0, 1, 1, 2, 3, 5, 8, 13])).to be true } | |
it { expect(fibonacci_like?([2, 6, 8, 14, 22, 36])).to be true } | |
it { expect(fibonacci_like?([0, 1, 1, 2, 3, 8])).to be false } | |
it { expect(fibonacci_like?([2, -1, 1, 0, 1, 1 , 2, 3])).to be true } | |
it { expect(fibonacci_like?([0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 45, 50])).to be false } | |
it { expect(fibonacci_like?([0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89])).to be true } | |
it { expect(fibonacci_like?([0.1, 0.1, 0.2, 0.3, 0.5, 0.8, 1.3, 2.1, 3.4, 5.5, 8.9, 14.4])).to be true } | |
it { expect(fibonacci_like?([-1, -1, -2, -3, -5, -8, -13, -21, -34, -55, -89])).to be true } | |
it { expect(fibonacci_like?([0, -1, -1, -2, -3, -5, -8, -13, -21, -34, -45, -50])).to be false } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment