Permalink
Browse files

Disable broken clojure command

  • Loading branch information...
devth committed Nov 10, 2017
1 parent 067d1b9 commit 5950e23399dda2da1a0275cd34a51f28efa7de4e
Showing with 21 additions and 14 deletions.
  1. +7 −4 src/yetibot/commands/clojure.clj
  2. +14 −10 test/yetibot/test/commands/clojure.clj
@@ -12,11 +12,14 @@
(defn clojure-cmd
"clj <expression> # evaluate a clojure expression"
{:yb/cat #{:broken}}
[{:keys [args]}]
(let [json (try-clojure args)]
(if (:error json)
(:message json)
(:result json))))
"tryclj.com is down :(")
;; (let [json (try-clojure args)]
;; (if (:error json)
;; (:message json)
;; (:result json))))
(cmd-hook #"clj"
#"\S*" clojure-cmd)
@@ -4,15 +4,19 @@
[yetibot.commands.clojure :refer :all]
[yetibot.core.util.http :refer [get-json map-to-query-string]]))
(fact "should eval as clojure code and return response from real service"
(clojure-cmd {:args "(* 10 2)"}) => "20")
;; tryclj.com is expired :(
(comment
(fact "should eval as clojure code and return response from real service"
(clojure-cmd {:args "(* 10 2)"}) => "20")
(fact "should eval as clojure code and return response"
(clojure-cmd {:args "(+ 1 2)"}) => "3"
(provided
(get-json anything) => {:expr "(+ 1 2)" :result "3"}))
(fact "should eval as clojure code and return response"
(clojure-cmd {:args "(+ 1 2)"}) => "3"
(provided
(get-json anything) => {:expr "(+ 1 2)" :result "3"}))
(fact "should return error message when request fail"
(clojure-cmd {:args "(+ 1 B)"}) => "Error"
(provided
(get-json anything) => {:error true :message "Error"}))
(fact "should return error message when request fail"
(clojure-cmd {:args "(+ 1 B)"}) => "Error"
(provided
(get-json anything) => {:error true :message "Error"}))
)

0 comments on commit 5950e23

Please sign in to comment.