Skip to content
This repository was archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Add some more profile assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
drewr committed Nov 5, 2015
1 parent b0a86ee commit c382396
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/runbld.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ email:
profiles:
foo-bar-baz:
email:
to: test@example.com
to: foo@example.com
template: test/foo.mustache

4 changes: 3 additions & 1 deletion test/runbld/test/build_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@
"--job-name" "foo,bar,baz"
"/path/to/script.bash"]))]
(is (= "test/foo.mustache"
(-> profiled-opts :email :template)))))
(-> profiled-opts :email :template)))
(is (= "foo@example.com"
(-> profiled-opts :email :to)))))
5 changes: 3 additions & 2 deletions test/runbld/test/publish_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@
(deftest email
(let [sent (atom [])]
(with-redefs [email/send* (fn [conn from to subj body]
(swap! sent conj body))
(swap! sent conj [to body]))
env/facter (fn [& args] {:some :fact})]
(let [opts (opts/parse-args ["-c" "test/runbld.yaml"
"--job-name" "foo,bar,baz"
"test/success.bash"])
res (main/run opts)]
(is (= ["greetings foo-bar-baz!\n"] @sent))))))
(is (= [["foo@example.com"
"greetings foo-bar-baz!\n"]] @sent))))))

0 comments on commit c382396

Please sign in to comment.