guile-bdd
A behavior driven development framework for the GNU Guile interpreter.
Build Instructions
The GNU buildsystem is used for building guile-bdd.
- ./configure
- make
- make install
Usage
For a usage example take a look at the unit tests in the `test’ directory or see the example application[1].
Include Module
For an example how the module can be included see following code snippet:
(use-modules (test bdd))
Define Story
For defining a story the `define-story’ and `scenario’ macros can be used. A little example code follows:
(define-story story-name "story description"
(in-order-to "intention")
(as-a "actor")
(i-want-to "action")
(scenario 1 "should ... (scenario description)"
(given ((given-value "value"))
(init))
(when ((actual-value (do-something given-value)))
(do-something-else))
(then
(assert-that actual-value is "expected value"))))
For more information on defining stories see the documentation of the `define-story’ and `scenario’ macros.
Run Tests
In the context of guile-bdd the term “verify if the behavior of the current environment matches the behavior specified by the given stories” is used instead of “run the given tests to verify the correctness of some code”. To verify that the current environment behaves as specified by some stories you defined you should use the `verify-behavior’ function. For more information on this see the example application[1] and/or the documentation of the `verify-behavior’ function.
License
See the LICENSE file.
Footnotes
[1] The GIT repo. of the example application: https://github.com/sirius94/guile-bdd-example