Skip to content

Instantly share code, notes, and snippets.

@Kuz-man
Last active October 28, 2016 18:43
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Kuz-man/1ad24e5c6e0bebdcdb7ccfdd3b88c41f to your computer and use it in GitHub Desktop.
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