Permalink
Browse files

Merge branch 'master' of https://github.com/logaan/vlad

  • Loading branch information...
2 parents d68afd2 + d563cf5 commit 4b8452810b5c158bde722c617955daf70f2f3bb7 @logaan committed Dec 19, 2013
Showing with 11 additions and 3 deletions.
  1. +4 −0 README.md
  2. +1 −1 project.clj
  3. +1 −1 src/vlad/validations.clj
  4. +5 −1 test/vlad/test/validations.clj
View
@@ -142,3 +142,7 @@ Copyright © 2012 Logan Campbell
Distributed under the Eclipse Public License, the same as Clojure.
+
+
+[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/logaan/vlad/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
+
View
@@ -1,7 +1,7 @@
(defproject vlad "1.1.0"
:description "Vlad is an attempt at providing convenient and simple
validations. Vlad is purely functional and makes no assumptions
- about your data. It can be used for validating html form data as
+ about your data. It can be used for validating html form data
just as well as it can be used to validate your csv about cats."
:url "https://github.com/logaan/vlad"
:license {:name "Eclipse Public License"
@@ -10,7 +10,7 @@
(validate (present :name)
{:name \"Vlad\"})"
[selector]
- (predicate selector str/blank? {:type ::present}))
+ (predicate selector #(if (string? %) (str/blank? %) true) {:type ::present}))
(defn length-over
"Checks that the `count` of the value found at `selector` is over `size`."
@@ -3,12 +3,16 @@
[vlad validations validation-types]))
(tabular
- (fact (validate ?validator {:name "Chris" :confirm_name "Brad"}) => ?errors)
+ (fact (validate ?validator {:name "Chris" :confirm_name "Brad" :number-of-teeth 32}) => ?errors)
?validator ?errors
(present [:name])
[]
+ (present [:number-of-teeth])
+ [{:type :vlad.validations/present
+ :selector [:number-of-teeth]}]
+
(present [:age])
[{:type :vlad.validations/present
:selector [:age]}]

0 comments on commit 4b84528

Please sign in to comment.