Skip to content

Instantly share code, notes, and snippets.

@leandrosilva
Created March 9, 2010 03:49
Show Gist options
  • Select an option

  • Save leandrosilva/326137 to your computer and use it in GitHub Desktop.

Select an option

Save leandrosilva/326137 to your computer and use it in GitHub Desktop.
Sample of very simple BDD with Eunit
-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