From 42e21c91537d3d243e16619ec07bff6f4681e357 Mon Sep 17 00:00:00 2001 From: Joshua Shaffer Date: Wed, 20 May 2020 11:14:11 -0400 Subject: [PATCH] Added test for show_dotfiles --- t/07-show_dotfiles.test | 21 +++++++++++++++++++++ t/show_dotfiles/.okay | 0 2 files changed, 21 insertions(+) create mode 100644 t/07-show_dotfiles.test create mode 100644 t/show_dotfiles/.okay diff --git a/t/07-show_dotfiles.test b/t/07-show_dotfiles.test new file mode 100644 index 0000000..6b56410 --- /dev/null +++ b/t/07-show_dotfiles.test @@ -0,0 +1,21 @@ +#! /bin/bash +cat <<--- +Test the option to show dotfiles. +-- +# Turn it on. +nginx_start 'fancyindex_show_dotfiles on;' +on_content=$(fetch /show_dotfiles/) +nginx_stop +if [ $(grep '.okay' <<< "${on_content}") -ne 0 ] ; then + exit 1 +fi + +# Turn it off. +nginx_start +off_content=$(fetch /show_dotfiles/) +nginx_stop +if [ $(grep '.okay' <<< "${on_content}") -eq 0] ; then + exit 1 +fi + +exit 0 diff --git a/t/show_dotfiles/.okay b/t/show_dotfiles/.okay new file mode 100644 index 0000000..e69de29