#* http://rosettacode.org/wiki/Test_a_function
  Test palindrome function using testing library
*#

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" }
  }
}