Created
March 9, 2010 03:49
-
-
Save leandrosilva/326137 to your computer and use it in GitHub Desktop.
Sample of very simple BDD with Eunit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -module(sample_erlang_bdd). | |
| -include_lib("eunit/include/eunit.hrl"). | |
| %%--- Spec 1 --------------------------- | |
| describe_truth_test_() -> | |
| [fun should_be_true/0, | |
| fun should_be_false/0]. | |
| should_be_true() -> | |
| ?assertMatch(true, true). | |
| should_be_false() -> | |
| ?assertMatch(false, false). | |
| %%--- Spec 2 --------------------------- | |
| describe_lie_test_() -> | |
| [fun should_not_be_true/0, | |
| fun should_not_be_false/0]. | |
| should_not_be_true() -> | |
| ?assertNot(true =:= false). | |
| should_not_be_false() -> | |
| ?assertNot(false =:= true). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment