Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test reporters' output.

  • Loading branch information...
commit 1227ba1fe452f8b399ff34ccd290fd63e744b0f5 1 parent 64766de
@RyanMcG RyanMcG authored
Showing with 36 additions and 0 deletions.
  1. +36 −0 test/kibit/test/reporters.clj
View
36 test/kibit/test/reporters.clj
@@ -0,0 +1,36 @@
+(ns kibit.test.reporters
+ (:require [kibit.reporters :as reporters]
+ [clojure.string :as string]
+ [clojure.test :refer :all]))
+
+(deftest plain
+ (are [check-map result]
+ (= (with-out-str (reporters/cli-reporter check-map))
+ (string/join "\n" result))
+ {:file "some/file.clj"
+ :line 30
+ :expr '(+ x 1)
+ :alt '(inc x)} ["At some/file.clj:30:"
+ "Consider using:"
+ " (inc x)"
+ "instead of:"
+ " (+ x 1)"
+ "" ""]))
+(deftest gfm
+ (are [check-map result]
+ (= (with-out-str (reporters/gfm-reporter check-map))
+ (string/join "\n" result))
+ {:file "some/file.clj"
+ :line 30
+ :expr '(+ x 1)
+ :alt '(inc x)} ["----"
+ "##### `some/file.clj:30`"
+ "Consider using:"
+ "```clojure"
+ " (inc x)"
+ "```"
+ "instead of:"
+ "```clojure"
+ " (+ x 1)"
+ "```"
+ "" ""]))
Please sign in to comment.
Something went wrong with that request. Please try again.