 
     (is (thrown-with-msg? clojure.lang.ExceptionInfo
                           #"Value does not match schema: \{:foo missing-required-key\}"
-                          (s/validate {:foo (defaulted-maybe s/Int 10)}
+                          (s/validate {:foo (defaulted-maybe Number 10)}
                                       {})))
 
     (is (= {:foo 10}

  (are [expected target-schema source-schema value]
    (= expected ((get-construct-fn target-schema) source-schema value))

    (time/minutes 10) Minutes s/String "10"
    (time/minutes 10) Minutes s/Int 10

    (time/secs 10) Seconds s/String "10"
    (time/secs 10) Seconds s/Int 10

    (time/days 10) Days s/String "10"
    (time/days 10) Days s/Int 10

    (pl-time/parse-period "10d") Period s/String "10d"

    true SchemaBoolean s/String "true"
    false SchemaBoolean s/String "false"
    true SchemaBoolean s/String "TRUE"
    false SchemaBoolean s/String "FALSE"
    true SchemaBoolean s/String "True"
    false SchemaBoolean s/String "False"
    false SchemaBoolean s/String "really false"))

(deftest schema-conversion
  (testing "conversion of days/minutes/seconds"

                (s/validate defaulted-schema))))))

(deftest defaulted-maybe?-test
  (is (true? (defaulted-maybe? (defaulted-maybe Number 10))))
  (is (false? (defaulted-maybe? (s/maybe Number)))))

(deftest defaulted-maybe-keys-test
  (is (= [:foo]
         (defaulted-maybe-keys
           {:foo (defaulted-maybe Number 1)
            :bar (s/maybe Number)
            :baz String}))))

(deftest schema-key->data-key-test
  (are [x y] (= x (schema-key->data-key y))
