27 lines
513 B
Ruby
27 lines
513 B
Ruby
require "minitest/autorun"
|
|
|
|
$LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib"
|
|
|
|
require "sensitive"
|
|
|
|
ALPHABET = ("a".."z").reduce(:concat)
|
|
|
|
class TestSensitive < Minitest::Test
|
|
def setup
|
|
@s = Sensitive.new ALPHABET
|
|
end
|
|
|
|
def test_initialize
|
|
assert_equal @s.to_s, "ab" + "*" * 22 + "yz"
|
|
end
|
|
|
|
def test_unwrap
|
|
assert_equal @s.unwrap, ALPHABET
|
|
end
|
|
|
|
def test_using_a_different_mask_character
|
|
s = Sensitive.new ALPHABET, ch: "x"
|
|
assert_equal s.to_s, "ab" + "x" * 22 + "yz"
|
|
end
|
|
end
|