summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2008-09-13 17:32:46 +0000
committerDamien F. Katz <damien@apache.org>2008-09-13 17:32:46 +0000
commit58cd856811cf0e0238bcb14792711672ba687175 (patch)
tree50565ed1daa1a0966a301458f5dcb838828af478 /test
parent48d2d8c0e97aa39eab674aea580a569d8aedd5c7 (diff)
Changes and refactorings to couch_config
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@694989 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/couch_config_test.erl39
1 files changed, 11 insertions, 28 deletions
diff --git a/test/couch_config_test.erl b/test/couch_config_test.erl
index 7db45bd7..faacd5fc 100644
--- a/test/couch_config_test.erl
+++ b/test/couch_config_test.erl
@@ -5,45 +5,28 @@
% that run the actual tests.
couch_config_test() ->
[
- fun() -> store_tuples() end,
- fun() -> store_strings() end,
- fun() -> store_numbers() end,
- fun() -> store_tuple_key() end
+ fun() -> store_strings() end
].
% test functions
-
-% test storing different types and see if they come back
-% the same way there put in.
-store_tuples() ->
- store(key, value).
store_strings() ->
- store("key", "value").
-
-store_numbers() ->
- store("number_key", 12345).
-
-store_tuple_key() ->
- store({key, subkey}, value).
-
-
-store(Key2, Value2) ->
- Filename = "local.ini",
+ Filename = "test.ini",
file:write_file(Filename, ""),
- Key = binary_to_list(term_to_binary(Key2)),
- Value = binary_to_list(term_to_binary(Value2)),
-
- couch_config:start_link(["local.ini"]),
+ Key = "foo",
+ Value = "bar",
- couch_config:store({"test_module", Key}, Value),
- Result = couch_config:get({"test_module", Key}),
- couch_config:unset(Key),
+ {ok, Proc} = couch_config:start_link([Filename]),
- couch_config:terminate(end_of_test, ok),
+ couch_config:set("test_module", Key, Value),
+ Result = couch_config:get("test_module", Key),
+ couch_config:delete("test_module", Key),
+ exit(Proc, kill),
+ receive {'EXIT', Proc, _} -> ok end,
+
% clean up
file:delete(Filename),