Overview

The project URL for BDD::Behave is https://github.com/gdonald/BDD-Behave.

The latest version of this documentation lives at https://docs.behave.dev.

The homepage for BDD::Behave is https://behave.dev.

Synopsis#

BDD::Behave is a behavior-driven development framework for Raku. Specs are ordinary Raku files that use BDD::Behave; and call exported DSL helpers (describe, context, it, let, before-each, expect, …) to build and run a tree of examples.

Currently developed against Raku v6.d.

Example Usage#

specs/001-spec.raku

use BDD::Behave;

describe 'this spec', {
  let(:answer, { 42 });

  it 'passes', {
    expect(answer).to.be(42);
  }
}

describe 'this final spec', {
  let(:answer, { 42 });

  it 'fails at line 15', {
    expect(answer).to.be(41);
  }
}

Run it with the behave runner:

$ behave specs/001-spec.raku

Output:

⮑  'this spec'
  ⮑  'passes'
    ⮑  SUCCESS
⮑  'this final spec'
  ⮑  'fails at line 15'
    ⮑  FAILURE

Failures:

  [ ✗ ] specs/001-spec.raku:15
      Expected: 42
      to be: 41

2 examples, 1 failed, 1 passed

Install#

BDD::Behave can be installed using the zef module installation tool:

zef install BDD::Behave