aboutsummaryrefslogtreecommitdiff
path: root/test/insert.t
diff options
context:
space:
mode:
authorTad Fisher <tadfisher@gmail.com>2017-03-16 14:44:29 -0700
committerGitHub <noreply@github.com>2017-03-16 14:44:29 -0700
commit329947aaff5e3cfeb1f6711a69c0bf82dba20a61 (patch)
treebf8388ffa7c56cde96df8438726f6585905fed1b /test/insert.t
parent12e151e24d4ad8dbebd7ccc26c02fb8fbfc6c02e (diff)
parent0892ebdc59c5eb080d616b2abea57913d70f84f9 (diff)
Merge pull request #12 from tadfisher/tests
Add test harness and basic insert test
Diffstat (limited to 'test/insert.t')
-rwxr-xr-xtest/insert.t19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/insert.t b/test/insert.t
new file mode 100755
index 0000000..a78971f
--- /dev/null
+++ b/test/insert.t
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+export test_description="Tests pass otp insert commands"
+
+. ./setup.sh
+
+test_expect_success 'Inserts a basic TOTP key' '
+ "$PASS" init $KEY1 &&
+ "$PASS" otp insert totp -s AAAAAAAAAAAAAAAAAAAAA totp-secret
+'
+
+test_expect_success 'Commits insert to git' '
+ git init "$PASSWORD_STORE_DIR" &&
+ "$PASS" init $KEY1 &&
+ "$PASS" otp insert totp -s AAAAAAAAAAAAAAAAAAAAA totp-secret2 &&
+ git log --no-decorate -1 | grep "Add given OTP secret for totp-secret2 to store."
+'
+
+test_done