summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Doane <jaydoane@apache.org>2020-02-20 22:06:43 -0800
committerPaul J. Davis <paul.joseph.davis@gmail.com>2020-03-02 12:26:22 -0600
commitc95d8c15584ce240f8d498a8faca2af5893bc06e (patch)
tree84b7aed573be1bc2496e2cee14b669106282b10b
parentbab35666a0223f184e2cc32bbc592584d05b0917 (diff)
downloadcouchdb-c95d8c15584ce240f8d498a8faca2af5893bc06e.tar.gz
Improve validate_dbname test
It's possible for other couch_epi plugins to interfere with this test, so mock `couch_epi:decide/5` to always return `no_decision`.
-rw-r--r--src/fabric/test/fabric2_db_misc_tests.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/fabric/test/fabric2_db_misc_tests.erl b/src/fabric/test/fabric2_db_misc_tests.erl
index c48ee2c73..42a63e2f9 100644
--- a/src/fabric/test/fabric2_db_misc_tests.erl
+++ b/src/fabric/test/fabric2_db_misc_tests.erl
@@ -141,7 +141,15 @@ validate_dbname(_) ->
Expect = {error, {Reason, DbName}},
?assertEqual(Expect, fabric2_db:validate_dbname(DbName))
end,
- lists:foreach(CheckFun, Tests).
+ try
+ % Don't allow epi plugins to interfere with test results
+ meck:new(couch_epi, [passthrough]),
+ meck:expect(couch_epi, decide, 5, no_decision),
+ lists:foreach(CheckFun, Tests)
+ after
+ % Unload within the test to minimize interference with other tests
+ meck:unload()
+ end.
validate_doc_ids(_) ->