Skip to content

Instantly share code, notes, and snippets.

@zkessin
Created July 19, 2017 07:38
Show Gist options
  • Save zkessin/87d38dc408a2abd4122d7a4adab944eb to your computer and use it in GitHub Desktop.
Save zkessin/87d38dc408a2abd4122d7a4adab944eb to your computer and use it in GitHub Desktop.
%%% @author Zachary Kessin <>
%%% @copyright (C) 2017, Zachary Kessin
%%% @doc
%%%
%%% @end
%%% Created : 19 Jul 2017 by Zachary Kessin <>
-module(create_and_delete_db_eqc).
-include_lib("eqc/include/eqc.hrl").
-compile(export_all).
prop_create_delete_db() ->
?FORALL(DBS,
non_empty(list(utf8(16))),
begin
L = length( barrel:database_names()),
[begin
{ok, #{<<"database_id">> := Id}} = barrel:create_database(#{<<"database_id">> => Id}),
barrel:post(Id, #{<<"id">> => <<"1234">>,<<"content">> => <<"A">>}, #{}),
ok = barrel:delete_database(Id)
end|| Id <- DBS],
L1 = length( barrel:database_names()),
L == L1
end).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment