Skip to content

Commit 7b1f18d

Browse files
committed
Scaffold basic tests
1 parent e24b7e0 commit 7b1f18d

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

examples/minimal.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#_(
4-
"exec" "bb" "--classpath" "../src" "$0" "$@"
4+
"exec" "bb" "--classpath" "src" "$0" "$@"
55
)
66

77
(require '[ekspono.vero :as vero])

scripts/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
test/examples_test.clj

test/examples_test.clj

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
3+
#_(
4+
"exec" "bb" "$0" "$@"
5+
)
6+
7+
(ns vero-test
8+
(:require [clojure.test :refer [deftest is testing use-fixtures run-tests]]
9+
[clojure.java.shell :refer [sh]]
10+
[clojure.java.io :as io]
11+
[clojure.string :as string]))
12+
13+
(deftest test-minimal-example
14+
(testing "Testing examples/minimal.clj"
15+
(let [{exit :exit
16+
out :out
17+
err :err} (sh "./examples/minimal.clj")
18+
fixture "vero/running: (git rev-parse --show-toplevel)
19+
minimal.clj
20+
21+
Usage:
22+
minimal.clj hello
23+
24+
Options:
25+
-h --help Show this screen"]
26+
(is (= 0 exit))
27+
(is (= (string/trim out) (string/trim fixture))))))
28+
29+
(run-tests)
30+
31+
;; help emacs understand this is a clojure file
32+
;; Local Variables:
33+
;; mode: clojure
34+
;; End:

0 commit comments

Comments
 (0)