RosettaCodeData/Task/Test-a-function/Crystal/test-a-function.crystal
2020-02-17 23:21:07 -08:00

15 lines
292 B
Text

require "spec"
describe "palindrome" do
it "returns true for a word that's palindromic" do
palindrome("racecar").should be_true
end
it "returns false for a word that's not palindromic" do
palindrome("goodbye").should be_false
end
end
def palindrome(s)
s == s.reverse
end