Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Install Bats Using a Package

above edited this page Mar 11, 2016 · 8 revisions

Purpose

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.

Ubuntu

sudo add-apt-repository ppa:duggan/bats
sudo apt-get update
sudo apt-get install bats

openSUSE

Bats is available for openSUSE Tumbleweed (the rolling release), and will be available in the upcoming openSUSE Leap 42.1 release. To install it, run

zypper in bats

For older releases, take a look at the development project on OBS (Open Build Service). In the lower-right box you will find build results for all releases for which a Bats package is built.

For example, to install Bats on openSUSE 13.2:

  1. Click on the link corresponding to the distribution.

  2. Add the linked-to "download repository" as a zypper repository:

    zypper ar -f http://download.opensuse.org/repositories/devel:/tools/openSUSE_13.2 devel-tools
    
  3. Install bats the usual way: zypper in bats

Arch Linux

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

Mac OSX

Bats is available for Mac OSX using brew. If you don’t have brew already, discover it and install it here.

brew install bats
Clone this wiki locally