Skip to content

Commit

Permalink
Merge pull request #13 from andrestylianos/feature/simplify-structure
Browse files Browse the repository at this point in the history
Move test-doubles.core ns to test-doubles
  • Loading branch information
trikitrok authored Apr 5, 2018
2 parents cb41830 + 3c82ef3 commit 5aa55a7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ In the following example[<sup>2</sup>](#nota2), we stub the `rand` function to m
(ns greenpowermonitor.test-doubles.stubbing-with-returns-examples
(:require
[clojure.test :refer [deftest testing is]]
[greenpowermonitor.test-doubles.core :as td]))
[greenpowermonitor.test-doubles :as td]))

(deftest stubbing-functions-using-returns
(testing "make a function return a given sequence of values in successive calls"
Expand Down Expand Up @@ -55,7 +55,7 @@ In the following example, we stub the `rand` function so that it always returns
(ns greenpowermonitor.test-doubles.stubbing-with-constantly-examples
(:require
[clojure.test :refer [deftest testing is]]
[greenpowermonitor.test-doubles.core :as td]))
[greenpowermonitor.test-doubles :as td]))

(deftest stubbing-functions-using-constantly
(testing "make a function return always the same value"
Expand Down Expand Up @@ -89,7 +89,7 @@ a `nil` will be returned when the received parameters don't match any of the map
(ns greenpowermonitor.test-doubles.stubbing-with-maps-examples
(:require
[clojure.test :refer [deftest testing is]]
[greenpowermonitor.test-doubles.core :as td]))
[greenpowermonitor.test-doubles :as td]))

(defn do-some-computation-fn [_ _])

Expand Down Expand Up @@ -120,7 +120,7 @@ the calls to each spied function and the arguments passed to them in each call.
(ns greenpowermonitor.test-doubles.spying-examples
(:require
[clojure.test :refer [deftest testing is]]
[greenpowermonitor.test-doubles.core :as td]))
[greenpowermonitor.test-doubles :as td]))

(defn- some-function [a b]
(println a b))
Expand Down Expand Up @@ -155,7 +155,7 @@ In the following example, even though you call the `double-print-x-and-greet` fu
(ns greenpowermonitor.test-doubles.stubbing-with-returns-examples
(:require
[clojure.test :refer [deftest testing is]]
[greenpowermonitor.test-doubles.core :as td]))
[greenpowermonitor.test-doubles :as td]))

(defn- greetings-function []
(println "Hola!"))
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
:cljsbuild {:builds [{:id "unit-tests"
:source-paths ["src" "test"]
:compiler {:output-to "out/unit_tests.js"
:main greenpowermonitor.test-doubles.unit-tests-runner
:main greenpowermonitor.unit-tests-runner
:target :nodejs
:optimizations :none}}]})
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(ns greenpowermonitor.test-doubles.core
(ns greenpowermonitor.test-doubles
#?(:cljs (:require-macros
[greenpowermonitor.test-doubles.core])))
[greenpowermonitor.test-doubles])))

(def ^:dynamic *spies-atom* (atom {}))

Expand Down
7 changes: 0 additions & 7 deletions test/greenpowermonitor/test_doubles/unit_tests_runner.cljs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns greenpowermonitor.test-doubles.core-test
(ns greenpowermonitor.test-doubles-test
(:require
[clojure.test :refer [deftest is testing]]
[greenpowermonitor.test-doubles.core :as td]))
[greenpowermonitor.test-doubles :as td]))

(defn some-function [a b]
(println a b))
Expand Down
7 changes: 7 additions & 0 deletions test/greenpowermonitor/unit_tests_runner.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(ns greenpowermonitor.unit-tests-runner
(:require
[doo.runner :refer-macros [doo-tests]]
[greenpowermonitor.test-doubles-test]))

(doo-tests
'greenpowermonitor.test-doubles-test)

0 comments on commit 5aa55a7

Please sign in to comment.