-
Notifications
You must be signed in to change notification settings - Fork 1
Install Bats Using a Package
You may be able to find Bats pre-packaged for your operating system. If available, such a package may offer a convenient alternative to cloning the Github repository:
- The installation is usually shared by all users on the system.
- The
bats
command will typically be available without configuration of any kind. - Updates and bugfixes may be provided via the regular stream of package updates for your system.
sudo add-apt-repository ppa:duggan/bats
sudo apt-get update
sudo apt-get install bats
sudo dnf install bats
Bats is available for openSUSE Tumbleweed, as well as for openSUSE Leap 42.1 and later releases:
zypper install bats
For older releases, take a look at the development project on OBS (Open Build Service). You may find a repository containing a package for your target release, or build your own package using the sources found there.
Bats is available for Arch Linux. You can install the latest release from the community repository.
sudo pacman -Sy bash-bats
The development version can be installed from AUR using your favourite AUR helper.
pacaur -Sa bats-git
To install the old, sstephenson
bats
# coreutils is needed because busybox `readlink` is not supported by BATS
sudo apk add coreutils bats
sudo apk add ncurses # Needed to support 'pretty' output
to install the newer bats-core
sudo apk add coreutils ncurses
curl -L https://github.com/bats-core/bats-core/archive/master.zip | unzip -
sudo bash bats-core-master/install.sh /usr/local
rm -rf ./bats-core-master
Bats is available for Mac OSX using brew. If you don’t have brew already, discover and install it from here.
brew install bats-core
Installation with bpkg
$ bpkg install -g sstephenson/bats
basher install bats-core/bats-core
Which installs the GIT master version. To be able to check out other versions, add this before the command: BASHER_FULL_CLONE=true
This community-maintained documentation for Bats is about core/master
,
see sidebar interwiki or the about page for more info.