mirror of
https://github.com/octoleo/hosts.git
synced 2025-02-11 06:48:27 +00:00
Remove unnecessary setup operations in enable.bats and disable.bats.
This commit is contained in:
parent
ee2a851bc9
commit
73134c6b7b
@ -5,10 +5,6 @@ load test_helper
|
|||||||
# `hosts disable` #############################################################
|
# `hosts disable` #############################################################
|
||||||
|
|
||||||
@test "\`disable\` with no arguments exits with status 1." {
|
@test "\`disable\` with no arguments exits with status 1." {
|
||||||
{
|
|
||||||
run "$_HOSTS" add 0.0.0.0 example.com
|
|
||||||
}
|
|
||||||
|
|
||||||
run "$_HOSTS" disable
|
run "$_HOSTS" disable
|
||||||
printf "\$status: %s\n" "$status"
|
printf "\$status: %s\n" "$status"
|
||||||
printf "\$output: '%s'\n" "$output"
|
printf "\$output: '%s'\n" "$output"
|
||||||
@ -16,9 +12,6 @@ load test_helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "\`disable\` with no argument does not change the hosts file." {
|
@test "\`disable\` with no argument does not change the hosts file." {
|
||||||
{
|
|
||||||
run "$_HOSTS" add 0.0.0.0 example.com
|
|
||||||
}
|
|
||||||
_original="$(cat "${HOSTS_PATH}")"
|
_original="$(cat "${HOSTS_PATH}")"
|
||||||
|
|
||||||
run "$_HOSTS" disable
|
run "$_HOSTS" disable
|
||||||
@ -28,10 +21,6 @@ load test_helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "\`disable\` with no arguments prints help information." {
|
@test "\`disable\` with no arguments prints help information." {
|
||||||
{
|
|
||||||
run "$_HOSTS" add 0.0.0.0 example.com
|
|
||||||
}
|
|
||||||
|
|
||||||
run "$_HOSTS" disable
|
run "$_HOSTS" disable
|
||||||
printf "\$status: %s\n" "$status"
|
printf "\$status: %s\n" "$status"
|
||||||
printf "\$output: '%s'\n" "$output"
|
printf "\$output: '%s'\n" "$output"
|
||||||
|
@ -5,13 +5,6 @@ load test_helper
|
|||||||
# `hosts enable` ##############################################################
|
# `hosts enable` ##############################################################
|
||||||
|
|
||||||
@test "\`enable\` with no arguments exits with status 1." {
|
@test "\`enable\` with no arguments exits with status 1." {
|
||||||
{
|
|
||||||
run "$_HOSTS" add 0.0.0.0 example.com
|
|
||||||
run "$_HOSTS" add 0.0.0.0 example.net
|
|
||||||
run "$_HOSTS" add 127.0.0.2 example.com
|
|
||||||
run "$_HOSTS" disable example.com
|
|
||||||
}
|
|
||||||
|
|
||||||
run "$_HOSTS" enable
|
run "$_HOSTS" enable
|
||||||
printf "\$status: %s\n" "$status"
|
printf "\$status: %s\n" "$status"
|
||||||
printf "\$output: '%s'\n" "$output"
|
printf "\$output: '%s'\n" "$output"
|
||||||
@ -19,12 +12,6 @@ load test_helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "\`enable\` with no argument does not change the hosts file." {
|
@test "\`enable\` with no argument does not change the hosts file." {
|
||||||
{
|
|
||||||
run "$_HOSTS" add 0.0.0.0 example.com
|
|
||||||
run "$_HOSTS" add 0.0.0.0 example.net
|
|
||||||
run "$_HOSTS" add 127.0.0.2 example.com
|
|
||||||
run "$_HOSTS" disable example.com
|
|
||||||
}
|
|
||||||
_original="$(cat "${HOSTS_PATH}")"
|
_original="$(cat "${HOSTS_PATH}")"
|
||||||
|
|
||||||
run "$_HOSTS" enable
|
run "$_HOSTS" enable
|
||||||
@ -34,13 +21,6 @@ load test_helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "\`enable\` with no arguments prints help information." {
|
@test "\`enable\` with no arguments prints help information." {
|
||||||
{
|
|
||||||
run "$_HOSTS" add 0.0.0.0 example.com
|
|
||||||
run "$_HOSTS" add 0.0.0.0 example.net
|
|
||||||
run "$_HOSTS" add 127.0.0.2 example.com
|
|
||||||
run "$_HOSTS" disable example.com
|
|
||||||
}
|
|
||||||
|
|
||||||
run "$_HOSTS" enable
|
run "$_HOSTS" enable
|
||||||
printf "\$status: %s\n" "$status"
|
printf "\$status: %s\n" "$status"
|
||||||
printf "\$output: '%s'\n" "$output"
|
printf "\$output: '%s'\n" "$output"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user