Compare commits

..

2 commits

Author SHA1 Message Date
0e00da5c9a test first for core-serialize 2023-08-02 09:12:00 +02:00
774cc4338d mv old code out of the way 2023-08-02 09:01:21 +02:00
10 changed files with 28 additions and 29 deletions

View file

@ -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]))

View file

@ -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"})))

View file

@ -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]))

View file

@ -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"}))))