

Task

Using a well-known testing-specific library/module/suite for your language, write some tests for your language's entry in Palindrome.

If your language does not have a testing specific library well known to the language's community then state this or omit the language.



include :assert
 
palindrome? = { str | 
  str = str.downcase.sub /\s+/ ""
  str == str.reverse 
}
 
setup name: "palindrome test" {
  test "is a palindrome" {
    assert { palindrome? "abba" }
  }
 
  test "is not a palindrome" {
    assert_false { palindrome? "abb" }
  }
 
  test "is not a string" {
    assert_fail { palindrome? 1001 }
  }
 
  test "this test fails" {
    assert { palindrome? "blah blah" }
  }
}