Skip to content

Commit

Permalink
Test all enricher implementation functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nnichols committed Jun 26, 2023
1 parent 75a2cfd commit 249ef31
Show file tree
Hide file tree
Showing 5 changed files with 722 additions and 187 deletions.
5 changes: 5 additions & 0 deletions .clj-kondo/rewrite-clj/rewrite-clj/config.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{:lint-as
{rewrite-clj.zip/subedit-> clojure.core/->
rewrite-clj.zip/subedit->> clojure.core/->>
rewrite-clj.zip/edit-> clojure.core/->
rewrite-clj.zip/edit->> clojure.core/->>}}
14 changes: 13 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<url>https://github.com/Wall-Brew-Co/brewtility</url>
<connection>scm:git:git://github.com/Wall-Brew-Co/brewtility.git</connection>
<developerConnection>scm:git:ssh://[email protected]/Wall-Brew-Co/brewtility.git</developerConnection>
<tag>4300da9de39ab92086013c4e2cb838a06e34b126</tag>
<tag>75a2cfd9a2fb0f0911530ed8296bc52a2fca6c93</tag>
</scm>
<build>
<sourceDirectory>src</sourceDirectory>
Expand Down Expand Up @@ -81,6 +81,12 @@
<version>1.11.60</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>cider</groupId>
<artifactId>cider-nrepl</artifactId>
<version>0.31.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.wallbrew</groupId>
<artifactId>common-beer-data</artifactId>
Expand All @@ -99,6 +105,12 @@
<version>0.1.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>nrepl</groupId>
<artifactId>nrepl</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

Expand Down
14 changes: 8 additions & 6 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

:plugins [[com.github.clj-kondo/lein-clj-kondo "0.2.5"]
[com.wallbrew/lein-sealog "1.0.2"]
[lein-cljsbuild "1.1.8"]
[lein-project-version "0.1.0"]
[lein-cljsbuild/lein-cljsbuild "1.1.8"]
[lein-project-version/lein-project-version "0.1.0"]
[mvxcvi/cljstyle "0.15.0"]
[ns-sort "1.0.3"]]
[ns-sort/ns-sort "1.0.3"]]

:deploy-repositories [["clojars" {:url "https://clojars.org/repo"
:username :env/clojars_user
Expand All @@ -25,10 +25,12 @@
:deploy-branches ["master"]

:profiles {:uberjar {:aot :all}
:dev {:dependencies [[com.wallbrew/common-beer-data "1.3.0"]
:dev {:dependencies [[cider/cider-nrepl "0.31.0"]
[com.wallbrew/common-beer-data "1.3.0"]
[com.wallbrew/common-beer-format "2.2.1"]
[doo "0.1.11"]]
:plugins [[lein-doo "0.1.11"]]}}
[doo/doo "0.1.11"]
[nrepl/nrepl "1.0.0"]]
:plugins [[lein-doo/lein-doo "0.1.11"]]}}

:aliases {"test-build" ["do" "clean" ["cljsbuild" "once" "test"] ["doo" "once"] ["test"]]}

Expand Down
22 changes: 11 additions & 11 deletions src/brewtility/enrich/impl.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
:time time/measurements
:volume volume/measurements
:weight weight/measurements)
error-msg (str "Invalid unit for "
error-msg (str "Invalid target unit for "
(name conversion-type)
" conversion : `"
target-units
Expand Down Expand Up @@ -274,7 +274,7 @@
:time time/measurements
:volume volume/measurements
:weight weight/measurements)
error-msg (str "Invalid unit for "
error-msg (str "Invalid source unit for "
(name conversion-type)
" conversion : `"
source-units
Expand Down Expand Up @@ -378,7 +378,7 @@
(not valid-suffix?) (suffix-error :pressure suffix))]
(if (empty? errors)
opts
(throw (ex-info "Invalid options for `->displayable-pressure`: " errors)))))
(throw (ex-info "Invalid displayable pressure enrichment options: " errors)))))


(defn parse-enrich-displayable-specific-gravity-opts
Expand All @@ -401,7 +401,7 @@
(not valid-suffix?) (suffix-error :specific-gravity suffix))]
(if (empty? errors)
opts
(throw (ex-info "Invalid options for `->displayable-specific-gravity`: " errors)))))
(throw (ex-info "Invalid displayable specific gravity enrichment options: " errors)))))


(defn parse-enrich-displayable-temperature-opts
Expand Down Expand Up @@ -506,7 +506,7 @@
Since many enrichers can leverage the same options (for example, `:precision`) this function will check for common options.
However, it will defer to more selective values passed in with the following precedence:
`impl/fine-grain-target-units` > `system-of-measure`
`:fine-grain-target-units` > `system-of-measure`
`:fine-grain-precision` > `precision`
`:fine-grain-suffix` > `suffix`
Expand Down Expand Up @@ -549,7 +549,7 @@
Since many enrichers can leverage the same options (for example, `:precision`) this function will check for common options.
However, it will defer to more selective values passed in with the following precedence:
`impl/fine-grain-target-units` > `system-of-measure`
`:fine-grain-target-units` > `system-of-measure`
`:fine-grain-precision` > `precision`
`:fine-grain-suffix` > `suffix`
Expand Down Expand Up @@ -591,7 +591,7 @@
Since many enrichers can leverage the same options (for example, `:precision`) this function will check for common options.
However, it will defer to more selective values passed in with the following precedence:
`impl/fine-grain-target-units` > `system-of-measure`
`:fine-grain-target-units` > `system-of-measure`
`:fine-grain-precision` > `precision`
`:fine-grain-suffix` > `suffix`
Expand Down Expand Up @@ -633,7 +633,7 @@
Since many enrichers can leverage the same options (for example, `:precision`) this function will check for common options.
However, it will defer to more selective values passed in with the following precedence:
`impl/fine-grain-target-units` > `system-of-measure`
`:fine-grain-target-units` > `system-of-measure`
`:fine-grain-precision` > `precision`
`:fine-grain-suffix` > `suffix`
Expand Down Expand Up @@ -675,7 +675,7 @@
Since many enrichers can leverage the same options (for example, `:precision`) this function will check for common options.
However, it will defer to more selective values passed in with the following precedence:
`impl/fine-grain-target-units` > `system-of-measure`
`:fine-grain-target-units` > `system-of-measure`
`:fine-grain-precision` > `precision`
`:fine-grain-suffix` > `suffix`
Expand Down Expand Up @@ -717,7 +717,7 @@
Since many enrichers can leverage the same options (for example, `:precision`) this function will check for common options.
However, it will defer to more selective values passed in with the following precedence:
`impl/fine-grain-target-units` > `system-of-measure`
`:fine-grain-target-units` > `system-of-measure`
`:fine-grain-precision` > `precision`
`:fine-grain-suffix` > `suffix`
Expand Down Expand Up @@ -760,7 +760,7 @@
Since many enrichers can leverage the same options (for example, `:precision`) this function will check for common options.
However, it will defer to more selective values passed in with the following precedence:
`impl/fine-grain-target-units` > `system-of-measure`
`:fine-grain-target-units` > `system-of-measure`
`:fine-grain-precision` > `precision`
`:fine-grain-suffix` > `suffix`
Expand Down
Loading

0 comments on commit 249ef31

Please sign in to comment.