Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
Signed-off-by: suryapandian <[email protected]>
  • Loading branch information
suryapandian committed Nov 14, 2023
1 parent 34355f1 commit c4a4e16
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
data:
color: aHR0cHM6Ly9zdXJ5YXBhbmRpYW4ud29yZHByZXNzLmNvbS8=
kind: Secret
metadata:
creationTimestamp: "2042-11-04T10:11:22Z"
name: test-secret
namespace: test-namespace
type: Opaque
6 changes: 6 additions & 0 deletions test/yq.test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
rm test/output.json
}

@test "yq_in_place_edit" {
cat test/secret.yaml | yq -i '.metadata.name="updated-name"' > test/output.yaml
cat test/output.yaml | yq '.metadata.name' | grep 'updated-name'
rm test/output.yaml
}

@test "exit_codes" {
run yq -h
[ "$status" -eq 0 ]
Expand Down

0 comments on commit c4a4e16

Please sign in to comment.