From 65ead9e0eb76032d6b2687415fa543b845b87cd4 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Thu, 7 Feb 2019 10:24:20 -0500 Subject: [PATCH 1/4] Consistent 'note' format in readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 855a30ad..25748cf5 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ install Bats into `/usr/local`, $ cd bats-core $ ./install.sh /usr/local -Note that you may need to run `install.sh` with `sudo` if you do not have +__Note:__ You may need to run `install.sh` with `sudo` if you do not have permission to write to the installation prefix. ### Running Bats in Docker @@ -249,9 +249,9 @@ command, saves the exit status and output into special global variables, and then returns with a `0` status code so you can continue to make assertions in your test case. -> Note that the `run` helper executes its argument(s) in a subshell, so if -> writing tests against environmental side-effects like a variable's value -> being changed, these changes will not persist after `run` completes. +__Note:__ The `run` helper executes its argument(s) in a subshell, so if +writing tests against environmental side-effects like a variable's value +being changed, these changes will not persist after `run` completes. For example, let's say you're testing that the `foo` command, when passed a nonexistent filename, exits with a `1` status code and prints an error message. @@ -337,7 +337,7 @@ Or you can skip conditionally: } ``` -`setup` and `teardown` hooks still run for skipped tests. +__Note:__ `setup` and `teardown` hooks still run for skipped tests. ### `setup` and `teardown`: Pre- and post-test hooks From e6f9209431276cda921bd21009d5666a806faa07 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Thu, 7 Feb 2019 10:58:10 -0500 Subject: [PATCH 2/4] Move the run helper notes to bottom of section --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 25748cf5..36643f0c 100644 --- a/README.md +++ b/README.md @@ -249,10 +249,6 @@ command, saves the exit status and output into special global variables, and then returns with a `0` status code so you can continue to make assertions in your test case. -__Note:__ The `run` helper executes its argument(s) in a subshell, so if -writing tests against environmental side-effects like a variable's value -being changed, these changes will not persist after `run` completes. - For example, let's say you're testing that the `foo` command, when passed a nonexistent filename, exits with a `1` status code and prints an error message. @@ -280,6 +276,10 @@ without any arguments prints usage information on the first line: } ``` +__Note:__ The `run` helper executes its argument(s) in a subshell, so if +writing tests against environmental side-effects like a variable's value +being changed, these changes will not persist after `run` completes. + ### `load`: Share common code You may want to share common code across multiple test files. Bats includes a From 772469da14264391a3e077084e55f4c594e8c3f3 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Thu, 7 Feb 2019 11:12:26 -0500 Subject: [PATCH 3/4] remove manual TOC and insert toc-me marker This will allow the TOC to be kept up to date automatically by the bot. https://github.com/pholleran/toc-me --- README.md | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/README.md b/README.md index 36643f0c..754380d0 100644 --- a/README.md +++ b/README.md @@ -47,32 +47,7 @@ commit [0360811][]. It was created via `git clone --bare` and `git push ## Table of contents -- [Installation](#installation) - - [Supported Bash versions](#supported-bash-versions) - - [Homebrew](#homebrew) - - [npm](#npm) - - [Installing Bats from source](#installing-bats-from-source) - - [Running Bats in Docker](#running-bats-in-docker) - - [Building a Docker image](#building-a-docker-image) -- [Usage](#usage) -- [Writing tests](#writing-tests) - - [`run`: Test other commands](#run-test-other-commands) - - [`load`: Share common code](#load-share-common-code) - - [`skip`: Easily skip tests](#skip-easily-skip-tests) - - [`setup` and `teardown`: Pre- and post-test hooks](#setup-and-teardown-pre--and-post-test-hooks) - - [Code outside of test cases](#code-outside-of-test-cases) - - [File descriptor 3 (read this if Bats hangs)](#file-descriptor-3-read-this-if-bats-hangs) - - [Printing to the terminal](#printing-to-the-terminal) - - [Special variables](#special-variables) -- [Testing](#testing) -- [Support](#support) -- [Contributing](#contributing) -- [Contact](#contact) -- [Version history](#version-history) -- [Background](#background) - - [Why was this fork created?](#why-was-this-fork-created) - - [What's the plan and why?](#whats-the-plan-and-why) -- [Copyright](#copyright) + ## Installation From d3c985ea4d70456191a14b19c8381dbdd1b22337 Mon Sep 17 00:00:00 2001 From: "toc-me[bot]" Date: Thu, 7 Feb 2019 16:12:32 +0000 Subject: [PATCH 4/4] Update ToC for README.md --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 754380d0..e9a25ea2 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,35 @@ commit [0360811][]. It was created via `git clone --bare` and `git push +- [Installation](#installation) + * [Supported Bash versions](#supported-bash-versions) + * [Homebrew](#homebrew) + * [npm](#npm) + * [Installing Bats from source](#installing-bats-from-source) + * [Running Bats in Docker](#running-bats-in-docker) + + [Building a Docker image](#building-a-docker-image) +- [Usage](#usage) +- [Writing tests](#writing-tests) + * [`run`: Test other commands](#run-test-other-commands) + * [`load`: Share common code](#load-share-common-code) + * [`skip`: Easily skip tests](#skip-easily-skip-tests) + * [`setup` and `teardown`: Pre- and post-test hooks](#setup-and-teardown-pre--and-post-test-hooks) + * [Code outside of test cases](#code-outside-of-test-cases) + * [File descriptor 3 (read this if Bats hangs)](#file-descriptor-3-read-this-if-bats-hangs) + * [Printing to the terminal](#printing-to-the-terminal) + * [Special variables](#special-variables) +- [Testing](#testing) +- [Support](#support) +- [Contributing](#contributing) +- [Contact](#contact) +- [Version history](#version-history) +- [Background](#background) + * [Why was this fork created?](#why-was-this-fork-created) + * [What's the plan and why?](#whats-the-plan-and-why) +- [Copyright](#copyright) + + + ## Installation ### Supported Bash versions