Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from RyanMcG/master
Add GFM reporter, Allow user to select reporter with CL option
- Loading branch information
Showing
4 changed files
with
67 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)" | ||
"```" | ||
"" ""])) |