diff --git a/project.clj b/project.clj index 96680aa..f6db4ce 100644 --- a/project.clj +++ b/project.clj @@ -25,7 +25,7 @@ ; Must be provided by the user (typically only used in tests) [http-kit.fake "0.2.2" :scope "provided"] [nubank/state-flow "5.18.0" :scope "provided"] - [dev.nubank/clj-github-mock "0.3.0" :scope "provided"]] + [dev.nubank/clj-github-mock "0.4.0" :scope "provided"]] :cljfmt {:indents {flow [[:block 1]] assoc-some [[:block 0]]}} diff --git a/test/clj_github/changeset_test.clj b/test/clj_github/changeset_test.clj index 7e5d305..749a19a 100644 --- a/test/clj_github/changeset_test.clj +++ b/test/clj_github/changeset_test.clj @@ -1,8 +1,8 @@ (ns clj-github.changeset-test - (:require [clojure.test :refer :all] - [clj-github-mock.core :as mock.core] + (:require [clj-github-mock.core :as mock.core] [clj-github.changeset :as sut] [clj-github.httpkit-client :as client] + [clojure.test :refer :all] [org.httpkit.fake :as fake])) (defmacro with-client [[client initial-state] & body] @@ -14,6 +14,9 @@ (def initial-state {:orgs [{:name "nubank" :repos [{:name "repo" :default_branch "master"}]}]}) +(def string-content-with-special-chars + "This is a string with special characters: \uD83C\uDF89\uD83C\uDF89\uD83C\uDF89\uD83D\uDD25\uD83D\uDD25\uD83D\uDD25") + (deftest get-content-test (testing "get content from client if there is no change" (with-client [client initial-state] @@ -24,6 +27,15 @@ (let [revision (sut/from-branch! client "nubank" "repo" "master")] (is (= "content" (sut/get-content revision "file")))))) + (testing "get string content with special characters" + (with-client [client initial-state] + (-> (sut/orphan client "nubank" "repo") + (sut/put-content "file" string-content-with-special-chars) + (sut/commit! "initial commit") + (sut/create-branch! "master")) + (let [revision (sut/from-branch! client "nubank" "repo" "master")] + (is (= string-content-with-special-chars + (sut/get-content revision "file")))))) (testing "get changed content" (with-client [client initial-state] (-> (sut/orphan client "nubank" "repo")