Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,26 @@
def palindrome?(s)
s == s.reverse
end
require 'test/unit'
class MyTests < Test::Unit::TestCase
def test_palindrome_ok
assert(palindrome? "aba")
end
def test_palindrome_nok
assert_equal(false, palindrome?("ab"))
end
def test_object_without_reverse
assert_raise(NoMethodError) {palindrome? 42}
end
def test_wrong_number_args
assert_raise(ArgumentError) {palindrome? "a", "b"}
end
def test_show_failing_test
assert(palindrome?("ab"), "this test case fails on purpose")
end
end