Skip to content

Instantly share code, notes, and snippets.

@sranso
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sranso/9602483 to your computer and use it in GitHub Desktop.
Save sranso/9602483 to your computer and use it in GitHub Desktop.
require './palindrome'
describe '#next_palindrome' do
it "should return the next smallest number that is greater than the given number which is a palindrome" do
expect(next_palindrome(121)).to eq(131)
end
it "should return the next smallest number that is greater than the given number which is a palindrome" do
expect(next_palindrome(1221)).to eq(1331)
end
it "should return the next smallest number that is greater than the given number which is a palindrome" do
expect(next_palindrome(1991)).to eq(2002)
end
it "should return the next smallest number that is greater than the given number which is a palindrome" do
expect(next_palindrome(2199912)).to eq(2200022)
end
it "should return the next smallest number that is greater than the given number which is a palindrome" do
expect(next_palindrome(2129212)).to eq(2130312)
end
it "should return the next smallest number that is greater than the given number which is a palindrome" do
expect(next_palindrome(999)).to eq(1001)
end
it "should return the next smallest number that is greater than the given number which is a palindrome" do
expect(next_palindrome(99)).to eq(101)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment