Refactoring to use new namespaces

This matches the default testcontainers naming patterns and gets rid of
the hyphen
This commit is contained in:
Tim Zöller 2024-04-14 12:52:23 +02:00
parent 1297054b77
commit 3809bbb28c
7 changed files with 14 additions and 18 deletions

View file

@ -1,4 +1,4 @@
# clj-test-containers
# testcontainers-clj
[![Clojars Project](http://clojars.org/clj-test-containers/latest-version.svg)](http://clojars.org/clj-test-containers)
@ -11,17 +11,13 @@ This library is a lightweight wrapper around the [Testcontainers Java library](h
This library does not provide tools to include testcontainers in your testing lifecycle. As there are many different
test tools with different approaches to testing in the clojure world, handling the lifecycle is up to you.
## Integration with test runners
There is an [experimental kaocha plugin](https://github.com/lambdaschmiede/kaocha-testcontainers-plugin) you can try out
## Usage
The library provides a set of functions to interact with the testcontainers. A simple example, how to create a container
with a Docker label, could look like this:
```clojure
(require '[clj-test-containers.core :as tc])
(require '[testcontainers-clj.core :as tc])
(def container (-> (tc/create {:image-name "postgres:12.1"
:exposed-ports [5432]
@ -41,7 +37,7 @@ If you'd rather create a container from a Dockerfile in your project, it could l
```clojure
(require '[clj-test-containers.core :as tc])
(require '[testcontainers-clj.core :as tc])
(def container (-> (tc/create-from-docker-file {:env-vars {"FOO" "bar"}
:exposed-ports [80]
@ -52,7 +48,7 @@ If you'd rather create a container from a Dockerfile in your project, it could l
If you prefer to use prebuilt containers from the Testcontainers project, you can do it like this
```clojure
(require '[clj-test-containers.core :as tc])
(require '[testcontainers-clj.core :as tc])
(:import [org.testcontainers.containers PostgreSQLContainer])
(def container (-> (tc/init {:container (PostgreSQLContainer. "postgres:12.2")

View file

@ -15,7 +15,7 @@ The functions accept and return a map structure, which enables us to operate the
consistent way. The example shown with Java Interop above would look like this, when using the wrapped functions:
```clojure
(require '[clj-test-containers.core :as tc])
(require '[testcontainers-clj.core :as tc])
(deftest db-integration-test
(testing "A simple PostgreSQL integration test"

View file

@ -1,6 +1,6 @@
(ns clj-test-containers.core
(ns testcontainers-clj.core
(:require
[clj-test-containers.spec.core :as cs]
[testcontainers-clj.spec.core :as cs]
[clojure.spec.alpha :as s]
[clojure.string])
(:import

View file

@ -1,4 +1,4 @@
(ns clj-test-containers.spec.container
(ns testcontainers-clj.spec.container
(:require
[clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen])

View file

@ -1,7 +1,7 @@
(ns clj-test-containers.spec.core
(ns testcontainers-clj.spec.core
(:require
[clj-test-containers.spec.container :as csc]
[clj-test-containers.spec.network :as csn]
[testcontainers-clj.spec.container :as csc]
[testcontainers-clj.spec.network :as csn]
[clojure.spec.alpha :as s]))
(s/def ::wait-for

View file

@ -1,4 +1,4 @@
(ns clj-test-containers.spec.network
(ns testcontainers-clj.spec.network
(:require
[clojure.spec.alpha :as s])
(:import

View file

@ -1,6 +1,6 @@
(ns clj-test-containers.core-test
(ns testcontainers-clj.core-test
(:require
[clj-test-containers.core :as sut]
[testcontainers-clj.core :as sut]
[clojure.string :refer [includes?]]
[clojure.test :refer [deftest is testing]])
(:import