Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add some tests.

  • Loading branch information...
commit 3c0f89193165ca41828330765ab18d33e155cc8a 1 parent 9192dd2
Anthony Grimes Raynes authored
Showing with 16 additions and 7 deletions.
  1. +0 −7 test/clj_geni/core_test.clj
  2. +16 −0 test/geni/core_test.clj
7 test/clj_geni/core_test.clj
View
@@ -1,7 +0,0 @@
-(ns clj-geni.core-test
- (:use clojure.test
- clj-geni.core))
-
-(deftest a-test
- (testing "FIXME, I fail."
- (is (= 0 1))))
16 test/geni/core_test.clj
View
@@ -0,0 +1,16 @@
+(ns geni.core-test
+ (:use clojure.test)
+ (:require [geni.core :as geni]
+ [clojure.string :as string]))
+
+(def token (string/trim-newline (slurp "token")))
+
+(deftest read-test
+ (is (= {:name "Amos Elliston", :id "profile-101"}
+ (geni/read "/profile-101" {:token token, :fields ["name" "id"]}))))
+
+(deftest write-test
+ (let [document (geni/write "/document/add" {:token token, :title "foo", :text "foo"})]
+ (is (= "foo" (:title document)))
+ (is (= {:result "Deleted"}
+ (geni/write (str "/" (:id document) "/delete") {:token token})))))
Please sign in to comment.
Something went wrong with that request. Please try again.