mirror of
https://github.com/octoleo/hosts.git
synced 2024-11-22 04:45:11 +00:00
Test file
output against $HOSTS_PATH
.
This commit is contained in:
parent
ae9c4f0f4b
commit
4cf3bc0a63
@ -7,17 +7,7 @@ load test_helper
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "\`file\` prints file contents." {
|
||||
@test "\`file\` prints \$HOSTS_PATH contents." {
|
||||
run "$_HOSTS" file
|
||||
[[ "${lines[0]}" == "##" ]]
|
||||
[[ "${lines[1]}" == "# Host Database" ]]
|
||||
[[ "${lines[2]}" == "#" ]]
|
||||
[[ "${lines[3]}" == "# localhost is used to configure the loopback interface" ]]
|
||||
[[ "${lines[4]}" == "# when the system is booting. Do not change this entry." ]]
|
||||
[[ "${lines[5]}" == "##" ]]
|
||||
[[ "${lines[6]}" == "127.0.0.1 localhost" ]]
|
||||
[[ "${lines[7]}" == "255.255.255.255 broadcasthost" ]]
|
||||
[[ "${lines[8]}" == "::1 localhost" ]]
|
||||
[[ "${lines[9]}" == "fe80::1%lo0 localhost" ]]
|
||||
[[ "${lines[10]}" == "" ]]
|
||||
[[ "$output" == "$(cat $HOSTS_PATH)" ]]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user