mirror of
https://github.com/nishiki/manage-password.git
synced 2025-03-20 21:34:35 +00:00
add test cli for copy mode
This commit is contained in:
parent
90486d1e93
commit
5f29f7b6e8
1 changed files with 15 additions and 3 deletions
|
@ -129,7 +129,19 @@ class TestConfig < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_06_setup_wallet
|
def test_06_copy
|
||||||
|
data = YAML.load_file('./test/files/fixtures-import.yml')[1]
|
||||||
|
|
||||||
|
output = %x(
|
||||||
|
echo "#{@password}\np\nq" | mpw copy \
|
||||||
|
--disable-clipboard \
|
||||||
|
-p #{data['host']}
|
||||||
|
)
|
||||||
|
puts output
|
||||||
|
assert_match(data['password'], output)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_07_setup_wallet
|
||||||
path = '/tmp/'
|
path = '/tmp/'
|
||||||
gpg_key = 'test2@example.com'
|
gpg_key = 'test2@example.com'
|
||||||
|
|
||||||
|
@ -173,7 +185,7 @@ class TestConfig < Test::Unit::TestCase
|
||||||
assert_no_match(/path_wallet_default/, output)
|
assert_no_match(/path_wallet_default/, output)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_07_setup_config
|
def test_08_setup_config
|
||||||
gpg_key = 'user@example2.com'
|
gpg_key = 'user@example2.com'
|
||||||
gpg_exe = '/usr/bin/gpg2'
|
gpg_exe = '/usr/bin/gpg2'
|
||||||
wallet_dir = '/tmp/mpw'
|
wallet_dir = '/tmp/mpw'
|
||||||
|
@ -226,7 +238,7 @@ class TestConfig < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_08_generate_password
|
def test_09_generate_password
|
||||||
length = 24
|
length = 24
|
||||||
|
|
||||||
output = %x(
|
output = %x(
|
||||||
|
|
Loading…
Add table
Reference in a new issue