mirror of
https://github.com/amigan/rustypaste-pretty.git
synced 2024-10-18 21:31:49 -04:00
20 lines
331 B
Bash
20 lines
331 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
content="test data"
|
||
|
|
||
|
setup() {
|
||
|
echo "$content" > file
|
||
|
}
|
||
|
|
||
|
run_test() {
|
||
|
file_url=$(curl -s -F "file=@file" localhost:8000)
|
||
|
test "$file_url" = "http://localhost:8000/file.txt"
|
||
|
test "$content" = "$(cat upload/file.txt)"
|
||
|
test "$content" = "$(curl -s $file_url)"
|
||
|
}
|
||
|
|
||
|
teardown() {
|
||
|
rm file
|
||
|
rm -r upload
|
||
|
}
|