Skip to content

Commit

Permalink
add test that list does not match prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Fuentes committed Jun 15, 2017
1 parent 16fc0a0 commit 07103ba
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions store/ssmstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,16 @@ func TestList(t *testing.T) {
assert.Equal(t, "value", *secret.Value)
}
})

t.Run("List should only return exact matches on service name", func(t *testing.T) {
store.Write(SecretId{Service: "match", Key: "a"}, "val")
store.Write(SecretId{Service: "matchlonger", Key: "a"}, "val")

s, err := store.List("match", false)
assert.Nil(t, err)
assert.Equal(t, 1, len(s))
assert.Equal(t, "match.a", s[0].Meta.Key)
})
}

func TestHistory(t *testing.T) {
Expand Down

0 comments on commit 07103ba

Please sign in to comment.