Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support / inside of vault names #197

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add in test for listing subfolder
  • Loading branch information
Mythra committed Oct 6, 2020
commit 7957a28fcae05a0813bb96440018e4ea5f94c6a8
11 changes: 10 additions & 1 deletion lib/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestListVaults(t *testing.T) {
}

sort.Strings(vaults)
expected := []string{"aaa", "bbb", "ccc"}
expected := []string{"aaa", "bbb", "ccc", "subfolder/aaa"}
if !reflect.DeepEqual(expected, vaults) {
t.Fatalf("expected %#v, got %#v", expected, vaults)
}
Expand Down Expand Up @@ -128,6 +128,15 @@ func setupVaults(t *testing.T) {
t.Fatalf("failed to create vaulted DATA_HOME dir: %v", err)
}

err = os.Mkdir(filepath.Join(string(xdg.DATA_HOME), "vaulted", "subfolder"), 0700)
if err != nil {
t.Fatalf("failed to create vaulted DATA_HOME subfolder dir: %v", err)
}
err = ioutil.WriteFile(filepath.Join(string(xdg.DATA_HOME), "vaulted", "subfolder", "aaa"), []byte(VAULT_AAA), 0600)
if err != nil {
t.Fatalf("failed to write 'subfolder/aaa' home vault file: %v", err)
}

err = ioutil.WriteFile(filepath.Join(string(xdg.DATA_HOME), "vaulted", "aaa"), []byte(VAULT_AAA), 0600)
if err != nil {
t.Fatalf("failed to write 'aaa' home vault file: %v", err)
Expand Down