Compare commits
2 commits
3dd9ff8ed0
...
0e00da5c9a
Author | SHA1 | Date | |
---|---|---|---|
0e00da5c9a | |||
774cc4338d |
10 changed files with 28 additions and 29 deletions
|
@ -0,0 +1,5 @@
|
||||||
|
(ns org.domaindrivenarchitecture.activity-pub-poc.core
|
||||||
|
(:require [clojure.spec.alpha :as s]
|
||||||
|
[orchestra.core :refer [defn-spec]]
|
||||||
|
[org.domaindrivenarchitecture.activity-pub-poc.spec-helper :as sh]
|
||||||
|
[org.domaindrivenarchitecture.activity-pub-poc.activitystreams2 :as as]))
|
|
@ -1,28 +0,0 @@
|
||||||
(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2-legacy-test
|
|
||||||
(:require
|
|
||||||
[clojure.test :refer [deftest is are testing run-tests]]
|
|
||||||
[clojure.spec.test.alpha :as st]
|
|
||||||
[clojure.spec.alpha :as s]
|
|
||||||
[org.domaindrivenarchitecture.activity-pub-poc.activitystreams2-legacy :as sut]))
|
|
||||||
|
|
||||||
;(deftest id-test
|
|
||||||
; (is (s/valid? ::sut/id "https://social.bla/alyssa/status/RANDOMHASH")))
|
|
||||||
|
|
||||||
;(deftest type-test
|
|
||||||
; (is (s/valid? ::sut/type "Note"))
|
|
||||||
; (is (s/valid? ::sut/type "Link"))
|
|
||||||
; (is (not(s/valid? ::sut/type "non existing"))))
|
|
||||||
|
|
||||||
;(deftest object-test
|
|
||||||
; (is (s/valid? ::sut/Object "https://social.bla/alyssa/status/RANDOMHASH")
|
|
||||||
; (is (s/valid? ::sut/Object {:id "https://social.bla/alyssa/status/RANDOMHASH" :type "Page"}))))
|
|
||||||
;
|
|
||||||
;(deftest link-test
|
|
||||||
; (is (s/valid? ::sut/Link {:type "Link"})))
|
|
||||||
|
|
||||||
;(deftest Note-test
|
|
||||||
; (is (s/valid?
|
|
||||||
; ::sut/Note
|
|
||||||
; {:id "https://social.bla/alyssa/status/RANDOMHASH"
|
|
||||||
; :type "Note"
|
|
||||||
; :content "text"})))
|
|
|
@ -1,7 +1,6 @@
|
||||||
(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2-test
|
(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2-test
|
||||||
(:require
|
(:require
|
||||||
[clojure.test :refer [deftest is are testing run-tests]]
|
[clojure.test :refer [deftest is are testing run-tests]]
|
||||||
[clojure.spec.test.alpha :as st]
|
|
||||||
[clojure.spec.alpha :as s]
|
[clojure.spec.alpha :as s]
|
||||||
[org.domaindrivenarchitecture.activity-pub-poc.activitystreams2 :as sut]))
|
[org.domaindrivenarchitecture.activity-pub-poc.activitystreams2 :as sut]))
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
(ns org.domaindrivenarchitecture.activity-pub-poc.core-test
|
||||||
|
(:require
|
||||||
|
[clojure.test :refer [deftest is are testing run-tests]]
|
||||||
|
[clojure.spec.alpha :as s]
|
||||||
|
[org.domaindrivenarchitecture.activity-pub-poc.core :as sut]))
|
||||||
|
|
||||||
|
(deftest should-serailize
|
||||||
|
(is (= "{
|
||||||
|
\"@context\": \"https://www.w3.org/ns/activitystreams\",
|
||||||
|
\"summary\": \"Sally liked a note\",
|
||||||
|
\"type\": \"Like\",
|
||||||
|
\"actor\": {
|
||||||
|
\"type\": \"Person\",
|
||||||
|
\"name\": \"Sally\"
|
||||||
|
},
|
||||||
|
\"object\": \"http://example.org/notes/1\"
|
||||||
|
}"
|
||||||
|
(sut/serialize
|
||||||
|
{:summary "Sally liked a note",
|
||||||
|
:type "Like",
|
||||||
|
:actor {:type "Person",
|
||||||
|
:name "Sally"},
|
||||||
|
:object "http://example.org/notes/1"}))))
|
Loading…
Reference in a new issue