From c48d16cbce1dc082bc0b2f8ab3f34e7c0829cf89 Mon Sep 17 00:00:00 2001 From: Anish Athalye Date: Wed, 13 Jan 2016 11:29:12 -0500 Subject: Use standard library JSON parser for JSON files This patch reverts the changes to the README made in 57265f78b4e4f6ca67393f55b2b08f6f45a02ff1 and makes it so that Dotbot supports JSON files with tab characters. --- test/test-lib.bash | 9 +++++++++ test/tests/config-json-tabs.bash | 20 ++++++++++++++++++++ test/tests/config-json.bash | 20 ++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 test/tests/config-json-tabs.bash create mode 100644 test/tests/config-json.bash (limited to 'test') diff --git a/test/test-lib.bash b/test/test-lib.bash index 425ae56..bb4b234 100644 --- a/test/test-lib.bash +++ b/test/test-lib.bash @@ -1,6 +1,7 @@ DEBUG=false DOTFILES='/home/vagrant/dotfiles' INSTALL_CONF='install.conf.yaml' +INSTALL_CONF_JSON='install.conf.json' test_run_() { if ! ${DEBUG}; then @@ -48,4 +49,12 @@ run_dotbot() { ) } +run_dotbot_json() { + ( + cd "${DOTFILES}" + cat > "${INSTALL_CONF_JSON}" + /dotbot/bin/dotbot -d . -c "${INSTALL_CONF_JSON}" "${@}" + ) +} + initialize diff --git a/test/tests/config-json-tabs.bash b/test/tests/config-json-tabs.bash new file mode 100644 index 0000000..4acc230 --- /dev/null +++ b/test/tests/config-json-tabs.bash @@ -0,0 +1,20 @@ +test_description='json config with tabs allowed' +. '../test-lib.bash' + +test_expect_success 'setup' ' +echo "grape" > ${DOTFILES}/h +' + +test_expect_success 'run' ' +run_dotbot_json < ${DOTFILES}/h +' + +test_expect_success 'run' ' +run_dotbot_json <