Skip to content

Commit

Permalink
rename valid-on-date to valid-on-date?
Browse files Browse the repository at this point in the history
  • Loading branch information
ryfow committed Jan 1, 2017
1 parent 8842346 commit a457b6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/buddy/core/certificates.clj
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
[cert]
(.getNotAfter cert))

(defn valid-on-date
(defn valid-on-date?
"Returns true if certificate is valid date. Defaults to today"
([certificate date]
(.isValidOn certificate date))
([certificate]
(valid-on-date certificate (java.util.Date.))))
(valid-on-date? certificate (java.util.Date.))))

(defn subject
"Returns the subject of the certificate"
Expand Down
10 changes: 5 additions & 5 deletions test/buddy/core/certificates_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
(let [expired (certificates/certificate "test/_files/expired-rsa.crt")]
(is (= #inst "2016-12-02T16:18:40.000-00:00" (certificates/not-before expired)))
(is (= #inst "2016-12-02T16:18:40.000-00:00" (certificates/not-after expired)))
(is (not (certificates/valid-on-date expired)))
(is (certificates/valid-on-date expired #inst "2016-12-02T16:18:40.000-00:00"))
(is (certificates/valid-on-date expired #inst "2016-12-02T16:17:40.000-00:00"))
(is (not (certificates/valid-on-date expired #inst "2016-12-01T16:17:40.000-00:00")))
(is (not (certificates/valid-on-date expired #inst "2016-12-03T16:17:40.000-00:00"))) ))
(is (not (certificates/valid-on-date? expired)))
(is (certificates/valid-on-date? expired #inst "2016-12-02T16:18:40.000-00:00"))
(is (certificates/valid-on-date? expired #inst "2016-12-02T16:17:40.000-00:00"))
(is (not (certificates/valid-on-date? expired #inst "2016-12-01T16:17:40.000-00:00")))
(is (not (certificates/valid-on-date? expired #inst "2016-12-03T16:17:40.000-00:00"))) ))


(deftest subject
Expand Down

0 comments on commit a457b6f

Please sign in to comment.