A behavior driven development framework written in Raku.
Currently developed against Raku v6.d.
zef install BDD::Behave
If a file is not specified Behave will automatically look for a specs directory and will run anything matching /spec.raku/.
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 12', {
expect(:answer).to.be(41);
}
}You can run the spec like this:
$ behave specs/001-spec.raku
Output:
specs/001-spec.raku
⮑ 'this spec'
⮑ 'passes'
⮑ SUCCESS
⮑ 'this final spec'
⮑ 'fails on the next line'
⮑ FAILURE
Failures:
[ ✗ ] specs/001-spec.raku:12For local development of Behave itself:
raku -Ilib bin/behave
To run the tests in t/*:
prove6 -Ilib t
See the examples in specs/*.
Behave is released under the Artistic License 2.0