testing

Testing tools, testing philosophy & methodology...
fabrao 2018-10-10T20:29:01.000100Z

Hello all, how can I use a clojure file that can be used for all my test files? I tried using in test/clj/util/common.clj but it says that can´t find it

fabrao 2018-10-10T20:33:34.000100Z

I have the same fixture to my tests, so I have the common thing for all tests

seancorfield 2018-10-10T20:35:20.000100Z

@fabrao You need to require it into each namespace that references it.

fabrao 2018-10-10T20:40:21.000100Z

@seancorfield I did it, can I create any clojure file in test folder to include it in my tests?

(ns db.notificacao.atributo-test
  (:require
   [clojure.test :refer :all]
   [db.notificacao.regra :refer :all]
   [db.notificacao.atributo :refer :all]
   [util.comum :refer :all] <-
   ))

fabrao 2018-10-10T20:41:53.000100Z

Unhandled java.io.FileNotFoundException
   Could not locate util/comum__init.class or util/comum.clj on
   classpath.

fabrao 2018-10-10T20:42:38.000100Z

If I go to the file and load it in repl, it works

fabrao 2018-10-10T20:43:00.000100Z

so I´m little lost how it works

seancorfield 2018-10-10T20:44:24.000100Z

If you are in the REPL, can you (require 'db.notificacao.atributo-test) ?

fabrao 2018-10-10T20:45:02.000100Z

yes, only the comum.clj is not loading

fabrao 2018-10-10T20:48:29.000100Z

nevermind, it´s easier to include fixture in each test file