View on GitHub

shellspec

BDD style testing framework for POSIX compatible shell script

Let’s test the your shell script!

Get started!

Features

Specfile syntax

Describe 'sample' # Example group block
  Describe 'bc command'
    add() { echo " + " | bc; }

    Example 'perform addition' # Example block
      When call add 2 2 # Evaluation
      The output should eq 4  # Expectation
    End
  End

  Describe 'implemented by shell function'
    . ./mylib.sh # add() function defined

    Example 'perform addition'
      When call add 2 2
      The output should eq 4
    End
  End
End

Reporter

Formatters

progress formatter (default)

documentation formatter

tap formatter