diff --git a/src/brewtility/enrich/impl.cljc b/src/brewtility/enrich/impl.cljc index 840449eb..ef8431b7 100644 --- a/src/brewtility/enrich/impl.cljc +++ b/src/brewtility/enrich/impl.cljc @@ -26,10 +26,12 @@ "The key to source data from in `enrich-displayable-*` functions" :value-key) + (def low-value-key "The key to source data from in `enrich-displayable-*` functions for the lower end of the range" :low-value-key) + (def high-value-key "The key to source data from in `enrich-displayable-*` functions for the higher end of the range" :high-value-key) @@ -395,12 +397,12 @@ precision (or fine-grain-precision precision) suffix (or fine-grain-suffix suffix) opts (parse-enrich-displayable-units-opts - measurement-type - {:target-units target-units - :source-units source-units - options/system-of-measure system-of-measure - options/precision precision - options/suffix suffix}) + measurement-type + {:target-units target-units + :source-units source-units + options/system-of-measure system-of-measure + options/precision precision + options/suffix suffix}) converted-low-value (units/convert measurement-type low-source-value source-units target-units {options/precision precision}) displayable-high-value (->displayable-units measurement-type high-source-value source-units target-units opts) displayable-range (str converted-low-value " - " displayable-high-value)] diff --git a/src/brewtility/predicates/equipment.cljc b/src/brewtility/predicates/equipment.cljc index 193a4699..d235ecc0 100644 --- a/src/brewtility/predicates/equipment.cljc +++ b/src/brewtility/predicates/equipment.cljc @@ -16,7 +16,9 @@ In the BeerXML spec, this behavior is implicitly falsey. Therefore, if the :calc-boil-volume field is not present, this function will explicitly return false." {:added "1.5"} - ([equipment] (calculated-boil-volume? equipment {})) ; Added to match the arity of the other predicate functions + ([equipment] (calculated-boil-volume? equipment {})) +; Added to match the arity of the other predicate functions + ([equipment _opts] (if (contains? equipment :calc-boil-volume) (:calc-boil-volume equipment) diff --git a/test/brewtility/enrich/impl_test.cljc b/test/brewtility/enrich/impl_test.cljc index ebda0e6a..2b060dc1 100644 --- a/test/brewtility/enrich/impl_test.cljc +++ b/test/brewtility/enrich/impl_test.cljc @@ -876,6 +876,7 @@ sut/value-key :value sut/fine-grain-target-units options/pound}))))))) + (deftest enrich-displayable-range-test (testing "Validate displayable range enrichment." (testing "If neither value is provided, return the original map." diff --git a/test/brewtility/predicates/options_test.cljc b/test/brewtility/predicates/options_test.cljc index b980c33d..07e0ea83 100644 --- a/test/brewtility/predicates/options_test.cljc +++ b/test/brewtility/predicates/options_test.cljc @@ -3,6 +3,7 @@ #? (:cljs [cljs.test :refer-macros [deftest is testing]]) [brewtility.predicates.options :as sut])) + (deftest type-test (testing "A sanity test for all option keywords" (is (keyword? sut/uppercase?))))