Created
October 5, 2012 09:29
-
-
Save lakshminarayanan/3838918 to your computer and use it in GitHub Desktop.
Anagram test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'turn/autorun' | |
class AnagramTest < MiniTest::Unit::TestCase | |
def test_simple_match | |
assert 'ABBA'.anagram? 'BABA' | |
end | |
def test_non_match | |
refute 'ABBA'.anagram? 'BAB' | |
end | |
def test_multi_word_match | |
assert 'Eleven Plus Two'.anagram? 'Twelve Plus One' | |
end | |
def test_multi_word_non_match | |
refute 'Debit Card'.anagram? 'Bad Debit' | |
end | |
def test_another_multi_word_match | |
assert 'Woman Hitler'.anagram? 'Mother in Law' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment