From 58cd856811cf0e0238bcb14792711672ba687175 Mon Sep 17 00:00:00 2001 From: "Damien F. Katz" Date: Sat, 13 Sep 2008 17:32:46 +0000 Subject: Changes and refactorings to couch_config git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@694989 13f79535-47bb-0310-9956-ffa450edef68 --- test/couch_config_test.erl | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) (limited to 'test/couch_config_test.erl') 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), -- cgit v1.2.3