add class to wrap sensitive values
This commit is contained in:
26
spec/sensitive_spec.rb
Normal file
26
spec/sensitive_spec.rb
Normal file
@ -0,0 +1,26 @@
|
||||
require "minitest/autorun"
|
||||
|
||||
$LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib"
|
||||
|
||||
require "sensitive"
|
||||
|
||||
ALPHABET = ('a' .. 'z').reduce(:concat)
|
||||
|
||||
describe "Sensitive" do
|
||||
before do
|
||||
@s = Sensitive.new ALPHABET
|
||||
end
|
||||
|
||||
it "test initialize" do
|
||||
_(@s.to_s).must_equal "ab" + "*" * 22 + "yz"
|
||||
end
|
||||
|
||||
it "test initialize" do
|
||||
_(@s.unwrap).must_equal ALPHABET
|
||||
end
|
||||
|
||||
it "test using different mask character" do
|
||||
s = Sensitive.new ALPHABET, ch: "x"
|
||||
_(s.to_s).must_equal "x"
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user