Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#258] create_schema/0 fixed and test added #260

Merged
merged 1 commit into from
Aug 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/adapter_test_helpers/sumo_basic_test_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

%% Test Cases - Helpers
-export([
create_schema/1,
find/1,
find_all/1,
find_by/1,
Expand All @@ -17,6 +18,14 @@
%%% Test Cases - Helpers
%%%=============================================================================

-spec create_schema(config()) -> ok.
create_schema(Config) ->
ok = sumo:create_schema(),
Tables = mnesia:system_info(tables),
{_, Name} = lists:keyfind(name, 1, Config),
true = lists:member(Name, Tables),
ok.

-spec find(config()) -> ok.
find(Config) ->
{_, Name} = lists:keyfind(name, 1, Config),
Expand Down
4 changes: 2 additions & 2 deletions src/sumo.erl
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ get_docs() ->
%% @doc Creates the schema for all known (configured) docs.
-spec create_schema() -> ok.
create_schema() ->
lists:foreach(fun({DocName, Store}) ->
create_schema(DocName, Store)
lists:foreach(fun({DocName, _, _}) ->
create_schema(DocName)
end, get_docs()).

%% @doc Returns 1 doc that matches the given Conditions.
Expand Down
1 change: 1 addition & 0 deletions test/sumo_basic_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
-include_lib("mixer/include/mixer.hrl").
-mixin([
{sumo_basic_test_helper, [
create_schema/1,
find/1,
find_all/1,
find_by/1,
Expand Down