small word test
This commit is contained in:
parent
47c0f62212
commit
7bb1c361a5
@ -162,7 +162,7 @@ module Parfait
|
||||
# compare the word to another
|
||||
# currently checks for same class, though really identity of the characters
|
||||
# in right order would suffice
|
||||
def == other
|
||||
def compare( other )
|
||||
return false if other.class != self.class
|
||||
return false if other.length != self.length
|
||||
len = self.length
|
||||
|
@ -1,5 +1,5 @@
|
||||
require_relative "../helper"
|
||||
|
||||
module Parfait
|
||||
class TestEmptyWord < MiniTest::Test
|
||||
|
||||
def setup
|
||||
@ -99,4 +99,15 @@ class TestWord < MiniTest::Test
|
||||
assert_equal v , @word.get_char(k)
|
||||
end
|
||||
end
|
||||
def test_not_same
|
||||
one = Parfait.new_word("one")
|
||||
two = Parfait.new_word("two")
|
||||
assert !one.compare(two)
|
||||
end
|
||||
def test_is_same
|
||||
one = Parfait.new_word("one")
|
||||
two = Parfait.new_word("one")
|
||||
assert one.compare(two)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user