mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-12 19:25:37 +00:00
Fixed acceptance tests
This commit is contained in:
parent
08fc058934
commit
d4b9781ee6
@ -1,46 +1,36 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
tearDown() {
|
|
||||||
set -e
|
|
||||||
}
|
|
||||||
|
|
||||||
testWriteInPlacePipeIn() {
|
testWriteInPlacePipeIn() {
|
||||||
set +e
|
|
||||||
result=$(./yq e -i -n '.a' 2>&1)
|
result=$(./yq e -i -n '.a' 2>&1)
|
||||||
assertEquals 1 $?
|
assertEquals 1 $?
|
||||||
assertEquals "Error: write inplace flag only applicable when giving an expression and at least one file" "$result"
|
assertEquals "Error: write inplace flag only applicable when giving an expression and at least one file" "$result"
|
||||||
}
|
}
|
||||||
|
|
||||||
testWriteInPlacePipeInEvalall() {
|
testWriteInPlacePipeInEvalall() {
|
||||||
set +e
|
|
||||||
result=$(./yq ea -i -n '.a' 2>&1)
|
result=$(./yq ea -i -n '.a' 2>&1)
|
||||||
assertEquals 1 $?
|
assertEquals 1 $?
|
||||||
assertEquals "Error: write inplace flag only applicable when giving an expression and at least one file" "$result"
|
assertEquals "Error: write inplace flag only applicable when giving an expression and at least one file" "$result"
|
||||||
}
|
}
|
||||||
|
|
||||||
testWriteInPlaceWithSplit() {
|
testWriteInPlaceWithSplit() {
|
||||||
set +e
|
|
||||||
result=$(./yq e -s "cat" -i '.a = "thing"' test.yml 2>&1)
|
result=$(./yq e -s "cat" -i '.a = "thing"' test.yml 2>&1)
|
||||||
assertEquals 1 $?
|
assertEquals 1 $?
|
||||||
assertEquals "Error: write inplace cannot be used with split file" "$result"
|
assertEquals "Error: write inplace cannot be used with split file" "$result"
|
||||||
}
|
}
|
||||||
|
|
||||||
testWriteInPlaceWithSplitEvalAll() {
|
testWriteInPlaceWithSplitEvalAll() {
|
||||||
set +e
|
|
||||||
result=$(./yq ea -s "cat" -i '.a = "thing"' test.yml 2>&1)
|
result=$(./yq ea -s "cat" -i '.a = "thing"' test.yml 2>&1)
|
||||||
assertEquals 1 $?
|
assertEquals 1 $?
|
||||||
assertEquals "Error: write inplace cannot be used with split file" "$result"
|
assertEquals "Error: write inplace cannot be used with split file" "$result"
|
||||||
}
|
}
|
||||||
|
|
||||||
testNullWithFiles() {
|
testNullWithFiles() {
|
||||||
set +e
|
|
||||||
result=$(./yq e -n '.a = "thing"' test.yml 2>&1)
|
result=$(./yq e -n '.a = "thing"' test.yml 2>&1)
|
||||||
assertEquals 1 $?
|
assertEquals 1 $?
|
||||||
assertEquals "Error: cannot pass files in when using null-input flag" "$result"
|
assertEquals "Error: cannot pass files in when using null-input flag" "$result"
|
||||||
}
|
}
|
||||||
|
|
||||||
testNullWithFilesEvalAll() {
|
testNullWithFilesEvalAll() {
|
||||||
set +e
|
|
||||||
result=$(./yq ea -n '.a = "thing"' test.yml 2>&1)
|
result=$(./yq ea -n '.a = "thing"' test.yml 2>&1)
|
||||||
assertEquals 1 $?
|
assertEquals 1 $?
|
||||||
assertEquals "Error: cannot pass files in when using null-input flag" "$result"
|
assertEquals "Error: cannot pass files in when using null-input flag" "$result"
|
||||||
|
Loading…
Reference in New Issue
Block a user