-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from mathiasburger/feature/configuration
Use openai compatible environment variables for configuration and allow configuration using more specific variables that do not interfere with the openai defaults
- Loading branch information
Showing
6 changed files
with
134 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env bats | ||
|
||
load $BATS_TEST_DIRNAME/../please.sh | ||
|
||
@test "join elements with a comma" { | ||
result=$(join_by ',' 'a' 'b' 'c') | ||
[ "$result" == "a,b,c" ] | ||
} | ||
|
||
@test "join elements with a semicolon" { | ||
result=$(join_by ';' '1' '2' '3') | ||
[ "$result" == "1;2;3" ] | ||
} | ||
|
||
@test "join with a space as delimiter" { | ||
result=$(join_by ' ' 'x' 'y' 'z') | ||
[ "$result" == "x y z" ] | ||
} | ||
|
||
@test "join with an empty delimiter" { | ||
result=$(join_by '' '1' '2' '3') | ||
[ "$result" == "123" ] | ||
} | ||
|
||
@test "no delimiter provided should return the first element" { | ||
result=$(join_by '' 'single') | ||
[ "$result" == "single" ] | ||
} | ||
|
||
@test "join using array with no elements" { | ||
qaMessages=() | ||
|
||
result=$(join_by , "${qaMessages[@]}") | ||
[ "$result" == "" ] | ||
} | ||
|
||
@test "join using array with one element" { | ||
qaMessages=("a") | ||
|
||
result=$(join_by , "${qaMessages[@]}") | ||
[ "$result" == "a" ] | ||
} | ||
|
||
@test "join using array with two elements" { | ||
qaMessages=("a" "b") | ||
|
||
result=$(join_by , "${qaMessages[@]}") | ||
[ "$result" == "a,b" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bats | ||
|
||
PLEASE_EXE=$BATS_TEST_DIRNAME/../please.sh | ||
|
||
@test "smoke test please --help" { | ||
result=$($PLEASE_EXE '--help') | ||
[ "${result:0:6}" == "Please" ] | ||
} | ||
|
||
@test "smoke test please --version" { | ||
result=$($PLEASE_EXE '--version') | ||
[ "${result:0:8}" == "Please v" ] | ||
} |