Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Roden-Corrent <ryrode@microsoft.com>2015-04-16 22:20:33 +0300
committerRyan Roden-Corrent <ryrode@microsoft.com>2015-04-21 21:21:52 +0300
commitf56a417de4b2b670b6c86017f73671a519989488 (patch)
treeaa21ea36884a5d780338762c66c5517097d0fc86 /tests/config
parenta060cccc0a51ee7eff92b674039bc7fc91dc5d46 (diff)
Specify mock config file content in test.
Instead of using a config file in resources, include the config file content to be tested directly in the test.
Diffstat (limited to 'tests/config')
-rw-r--r--tests/config/write.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/config/write.c b/tests/config/write.c
index 6318c49fe..bcc87571c 100644
--- a/tests/config/write.c
+++ b/tests/config/write.c
@@ -6,7 +6,6 @@ void test_config_write__initialize(void)
cl_fixture_sandbox("config/config9");
cl_fixture_sandbox("config/config15");
cl_fixture_sandbox("config/config17");
- cl_fixture_sandbox("config/config21");
}
void test_config_write__cleanup(void)
@@ -14,7 +13,6 @@ void test_config_write__cleanup(void)
cl_fixture_cleanup("config9");
cl_fixture_cleanup("config15");
cl_fixture_cleanup("config17");
- cl_fixture_cleanup("config21");
}
void test_config_write__replace_value(void)
@@ -114,12 +112,21 @@ void test_config_write__delete_value_at_specific_level(void)
*/
void test_config_write__delete_value_with_duplicate_header(void)
{
- const char *file_name = "config21";
+ const char *file_name = "config-duplicate-header";
const char *entry_name = "remote.origin.url";
git_config *cfg;
git_config_entry *entry;
- /* Make sure the expected entry exists */
+ /* This config can occur after removing and re-adding the origin remote */
+ const char *file_content =
+ "[remote \"origin\"]\n" \
+ "[branch \"master\"]\n" \
+ " remote = \"origin\"\n" \
+ "[remote \"origin\"]\n" \
+ " url = \"foo\"\n";
+
+ /* Write the test config and make sure the expected entry exists */
+ cl_git_mkfile(file_name, file_content);
cl_git_pass(git_config_open_ondisk(&cfg, file_name));
cl_git_pass(git_config_get_entry(&entry, cfg, entry_name));