You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2018/06/22 22:15:41 UTC

[couchdb] 12/31: DRY constant definition

This is an automated email from the ASF dual-hosted git repository.

chewbranca pushed a commit to branch elixir-suite
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 005d48b9dd06407a0906ba2d85ad1d9431aae591
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Thu Dec 7 10:40:40 2017 -0600

    DRY constant definition
---
 elixir_suite/test/uuids_test.exs | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/elixir_suite/test/uuids_test.exs b/elixir_suite/test/uuids_test.exs
index 8a9d7f4..563f73b 100644
--- a/elixir_suite/test/uuids_test.exs
+++ b/elixir_suite/test/uuids_test.exs
@@ -79,9 +79,10 @@ defmodule UUIDsTest do
     assert u1 < u2
   end
 
+  @utc_id_suffix "frog"
   @tag config: [
     {"uuids", "algorithm", "utc_id"},
-    {"uuids", "utc_id_suffix", "frog"}
+    {"uuids", "utc_id_suffix", @utc_id_suffix}
   ]
   test "utc_id uuids are correct" do
     resp = Couch.get("/_uuids", query: %{:count => 10})
@@ -89,8 +90,8 @@ defmodule UUIDsTest do
     [uuid | rest_uuids] = resp.body["uuids"]
 
     Enum.reduce(rest_uuids, uuid, fn curr, acc ->
-      assert String.length(curr) == 14 + String.length("frog")
-      assert String.slice(curr, 14..-1) == "frog"
+      assert String.length(curr) == 14 + String.length(@utc_id_suffix)
+      assert String.slice(curr, 14..-1) == @utc_id_suffix
       assert curr > acc
       curr
     end)