View on GitHub

spec.sh

Lovely shell testing framework for the 21st century

download .ZIPdownload .TGZ

🔬 Shell Specifications

  • Familiar syntax
  • Pleasant to write
  • Just one BASH file

spec.sh is a shell script testing library written for developer happiness 💝

If you’ve used any popular testing framework spec.sh should feel familiar!

Features

xUnit-style tests

setUp()    { directory="$( mktemp -d )"; }
tearDown() { rm -r "$directory"; }

testFileExists() {
  assert [ -f "$directory/file" ]
}

BDD-style specs

@before() { directory="$( mktemp -d )"; }
@after()  { rm -r "$directory"; }

@spec.file_should_exist() {
  expect { ls "$directory" } toContain "file"
}

Installation

curl -o- https://specs.sh/installer.sh | curl

Or click the .zip or .tar.gz download link at the top of the website!

Available versions

spec.sh comes in two varieties:

The installer script downloads the latest versions of these files, puts them into your current directory, and prints helpful usage documentation!

Getting Started

…

Integrated Libraries: assert, expect, run

…