Instantly share code, notes, and snippets.

Embed
What would you like to do?
Challenge 3
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