From 73134c6b7bc68443658f2b91584560511283feca Mon Sep 17 00:00:00 2001 From: William Melody Date: Tue, 26 Jan 2016 19:17:36 -0800 Subject: [PATCH] Remove unnecessary setup operations in enable.bats and disable.bats. --- test/disable.bats | 11 ----------- test/enable.bats | 20 -------------------- 2 files changed, 31 deletions(-) diff --git a/test/disable.bats b/test/disable.bats index 084fc8f..7d7aebc 100644 --- a/test/disable.bats +++ b/test/disable.bats @@ -5,10 +5,6 @@ load test_helper # `hosts disable` ############################################################# @test "\`disable\` with no arguments exits with status 1." { - { - run "$_HOSTS" add 0.0.0.0 example.com - } - run "$_HOSTS" disable printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output" @@ -16,9 +12,6 @@ load test_helper } @test "\`disable\` with no argument does not change the hosts file." { - { - run "$_HOSTS" add 0.0.0.0 example.com - } _original="$(cat "${HOSTS_PATH}")" run "$_HOSTS" disable @@ -28,10 +21,6 @@ load test_helper } @test "\`disable\` with no arguments prints help information." { - { - run "$_HOSTS" add 0.0.0.0 example.com - } - run "$_HOSTS" disable printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output" diff --git a/test/enable.bats b/test/enable.bats index 6c1038a..fcfb823 100644 --- a/test/enable.bats +++ b/test/enable.bats @@ -5,13 +5,6 @@ load test_helper # `hosts enable` ############################################################## @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 printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output" @@ -19,12 +12,6 @@ load test_helper } @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}")" run "$_HOSTS" enable @@ -34,13 +21,6 @@ load test_helper } @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 printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output"