BDD::Behave
Behave
A behavior-driven testing framework written in Raku.
Currently developed against Raku v6.d.
Install using zef
zef install BDD::BehaveRunning Behave
If no file is specified, Behave looks for a specs/ directory and runs every file in it whose name matches *spec.raku.
An example
specs/answer-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);
}
}You can run the spec like this:
behave --format=tree specs/answer-spec.rakuOutput:
ā® 'this spec'
ā® 'passes'
ā® SUCCESS
ā® 'this final spec'
ā® 'fails at line 15'
ā® FAILURE
Failures:
[ ā ] /path/to/project/specs/answer-spec.raku:15
this final spec fails at line 15
Expected: 42
to be: 41
2 examples, 1 failed, 1 passed
Randomized with seed 581808742Local Behave development
For local development of Behave itself:
raku -Ilib bin/behaveTests
To run the full test suite (both t/ and specs/):
raku test.rakuTo run just the t/ tests:
prove6 -Ilib tStatus
Documentation
Documentation: https://docs.behave.dev
See also the examples in specs/*.
Homepage
License
Copyright (c) 2019-2026 Greg Donald
This software is licensed under the Artistic License 2.0.