Permalink
Browse files

Revert "more details example"

This reverts commit 4d4da48.
  • Loading branch information...
1 parent 4d4da48 commit d9ac9bf0c7d863b9616b45f9eeb09e6a3bcfb320 @logaan committed Oct 14, 2013
Showing with 6 additions and 29 deletions.
  1. +3 −14 README.md
  2. +3 −15 test/vlad/test/readme.clj
View
@@ -22,20 +22,9 @@ API Docs: <http://logaan.github.io/vlad/vlad.html>
(:require [vlad :refer :all]
[midje.sweet :refer [fact]]))
-(let [data {:name "Logan Campbell"}
- errors (validate (present [:age]) data)
- named (assign-name errors {[:name] "Name" [:age] "Age"})
- translated (translate-errors named english-translation)]
-
- (fact
- errors => [{:type :vlad.validations/present
- :selector [:age]}]
-
- named => [{:type :vlad.validations/present
- :name "Age"
- :selector [:age]}]
-
- translated => {[:age] ["Age is required."]}))
+(fact (validate (present [:age]) {:name "Logan"})
+ => [{:type :vlad.validations/present
+ :selector [:age]}])
```
## Composition
View
@@ -3,21 +3,9 @@
[midje.sweet :refer [fact]]))
; Basics
-
-(let [data {:name "Logan Campbell"}
- errors (validate (present [:age]) data)
- named (assign-name errors {[:name] "Name" [:age] "Age"})
- translated (translate-errors named english-translation)]
-
- (fact
- errors => [{:type :vlad.validations/present
- :selector [:age]}]
-
- named => [{:type :vlad.validations/present
- :name "Age"
- :selector [:age]}]
-
- translated => {[:age] ["Age is required."]}))
+(fact (validate (present [:age]) {:name "Logan Campbell"})
+ => [{:type :vlad.validations/present
+ :selector [:age]}])
; Composition
(def common

0 comments on commit d9ac9bf

Please sign in to comment.