kubernaut/spec/sensitive_spec.rb
Ryan Cavicchioni 5c2c7ec3b7
Some checks failed
Gitea Actions Demo / lint (push) Successful in 2m12s
Gitea Actions Demo / test (push) Failing after 2m4s
Gitea Actions Demo / release-image (push) Has been skipped
fix lint errors
2025-03-09 16:12:50 -05:00

27 lines
495 B
Ruby

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