Scampi

A small Ruby test framework forked from Bacon with built-in TAP (Test Anything Protocol) output.

Requirements

  • Ruby >= 3.3
  • ripgrep (rg) — used to find test files

Usage

Tests can live alongside your code in an __END__ section — the specs never load in production (Ruby stops parsing at __END__), and scampi picks them up:

# greet.rb
def greet(name) = "hello #{name}"

__END__

Run a file (or let scampi auto-discover every .rb with an __END__ spec section):

$ scampi greet.rb
$ scampi

GitHub Actions

name: Test

on: [push, pull_request]

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: "3.3"
          bundler-cache: true

      - run: sudo apt-get install -y ripgrep

      - run: bundle exec scampi