Skip to content

Instantly share code, notes, and snippets.

Created November 12, 2015 17:01
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 anonymous/564e3f12d0b0c46a4533 to your computer and use it in GitHub Desktop.
Save anonymous/564e3f12d0b0c46a4533 to your computer and use it in GitHub Desktop.
gem 'cucumber'
def is_palindrome(str)
if str.downcase.reverse == str.downcase
puts('palindrome')
else
puts('NOT a palindrome')
end
end
puts 'Enter a string'
input_str = gets
is_palindrome(input_str.chomp)
Feature: lower case palindromes
This is testing the input of lower case strings
that may be palindromes
Scenario: testing lowercase
Given is_Palindrome is run
When the input string is "oofoo"
Then the result should be "palindrome"
Given(/^isPalindrome is run$/) do
@isPalindrome = isPalindrome.new
end
When(/^the input string is "([^"]*)"$/) do |arg1|
result = isPalindrome.is_palindrome(arg1)
end
Then(/^the result should be "([^"]*)"$/) do |expected_result|
result == expected_result.chomp
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment