mirror of
https://github.com/octoleo/hosts.git
synced 2025-04-06 23:41:51 +00:00
Improve formatting in tests.
This commit is contained in:
parent
1d948837d0
commit
8f6a700909
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
load test_helper
|
load test_helper
|
||||||
|
|
||||||
# `hosts block` #################################################################
|
# `hosts block` ###############################################################
|
||||||
|
|
||||||
@test "\`block\` with no arguments exits with status 1." {
|
@test "\`block\` with no arguments exits with status 1." {
|
||||||
run "${_HOSTS}" block
|
run "${_HOSTS}" block
|
||||||
@ -28,7 +28,7 @@ load test_helper
|
|||||||
[[ "${lines[1]}" == " hosts block <hostname>..." ]]
|
[[ "${lines[1]}" == " hosts block <hostname>..." ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
# `hosts block <hostname>` #################################################
|
# `hosts block <hostname>` ####################################################
|
||||||
|
|
||||||
@test "\`block <hostname>\` exits with status 0." {
|
@test "\`block <hostname>\` exits with status 0." {
|
||||||
run "${_HOSTS}" block example.com
|
run "${_HOSTS}" block example.com
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
load test_helper
|
load test_helper
|
||||||
|
|
||||||
# `hosts disabled` #############################################################
|
# `hosts disabled` ############################################################
|
||||||
|
|
||||||
@test "\`disabled\` with no arguments exits with status 0." {
|
@test "\`disabled\` with no arguments exits with status 0." {
|
||||||
{
|
{
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
load test_helper
|
load test_helper
|
||||||
|
|
||||||
# `hosts list` #############################################################
|
# `hosts list` ################################################################
|
||||||
|
|
||||||
@test "\`list\` exits with status 0." {
|
@test "\`list\` exits with status 0." {
|
||||||
{
|
{
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
load test_helper
|
load test_helper
|
||||||
|
|
||||||
# `hosts remove` #################################################################
|
# `hosts remove` ##############################################################
|
||||||
|
|
||||||
@test "\`remove\` with no arguments exits with status 1." {
|
@test "\`remove\` with no arguments exits with status 1." {
|
||||||
run "${_HOSTS}" remove
|
run "${_HOSTS}" remove
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
load test_helper
|
load test_helper
|
||||||
|
|
||||||
# `hosts search` #############################################################
|
# `hosts search` ##############################################################
|
||||||
|
|
||||||
@test "\`search\` with no arguments exits with status 1." {
|
@test "\`search\` with no arguments exits with status 1." {
|
||||||
{
|
{
|
||||||
@ -73,7 +73,7 @@ Description:
|
|||||||
[[ "${lines[4]}" =~ 127.0.0.2[[:space:]]+example.com ]]
|
[[ "${lines[4]}" =~ 127.0.0.2[[:space:]]+example.com ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
# `hosts search disabled` #######################################################
|
# `hosts search disabled` #####################################################
|
||||||
|
|
||||||
@test "\`search disabled\` exits with status 0." {
|
@test "\`search disabled\` exits with status 0." {
|
||||||
{
|
{
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
load test_helper
|
load test_helper
|
||||||
|
|
||||||
# `hosts show` ##############################################################
|
# `hosts show` ################################################################
|
||||||
|
|
||||||
@test "\`show\` with no arguments exits with status 1." {
|
@test "\`show\` with no arguments exits with status 1." {
|
||||||
run "${_HOSTS}" show
|
run "${_HOSTS}" show
|
||||||
@ -37,7 +37,7 @@ load test_helper
|
|||||||
[[ "${lines[0]}" =~ No\ matching\ entries ]]
|
[[ "${lines[0]}" =~ No\ matching\ entries ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
# `hosts show <ip>` #########################################################
|
# `hosts show <ip>` ###########################################################
|
||||||
|
|
||||||
@test "\`show <ip>\` exits with status 0 and shows all matches." {
|
@test "\`show <ip>\` exits with status 0 and shows all matches." {
|
||||||
{
|
{
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
load test_helper
|
load test_helper
|
||||||
|
|
||||||
# `hosts unblock` #################################################################
|
# `hosts unblock` #############################################################
|
||||||
|
|
||||||
@test "\`unblock\` with no arguments exits with status 1." {
|
@test "\`unblock\` with no arguments exits with status 1." {
|
||||||
run "${_HOSTS}" unblock
|
run "${_HOSTS}" unblock
|
||||||
@ -28,7 +28,7 @@ load test_helper
|
|||||||
[[ "${lines[1]}" == " hosts unblock <hostname>..." ]]
|
[[ "${lines[1]}" == " hosts unblock <hostname>..." ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
# `hosts unblock <invalid>` ############################################
|
# `hosts unblock <invalid>` ###################################################
|
||||||
|
|
||||||
@test "\`unblock <invalid> \` exits with status 1." {
|
@test "\`unblock <invalid> \` exits with status 1." {
|
||||||
{
|
{
|
||||||
@ -52,7 +52,7 @@ load test_helper
|
|||||||
[[ ${output} == "${_ERROR_PREFIX}No matching records found." ]]
|
[[ ${output} == "${_ERROR_PREFIX}No matching records found." ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
# `hosts unblock <hostname>` ###########################################
|
# `hosts unblock <hostname>` ##################################################
|
||||||
|
|
||||||
@test "\`unblock <hostname>\` exits with status 0." {
|
@test "\`unblock <hostname>\` exits with status 0." {
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user