summaryrefslogtreecommitdiff
path: root/test/elixir/lib/setup/common.ex
diff options
context:
space:
mode:
Diffstat (limited to 'test/elixir/lib/setup/common.ex')
-rw-r--r--test/elixir/lib/setup/common.ex27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/elixir/lib/setup/common.ex b/test/elixir/lib/setup/common.ex
new file mode 100644
index 000000000..e81f109c9
--- /dev/null
+++ b/test/elixir/lib/setup/common.ex
@@ -0,0 +1,27 @@
+defmodule Couch.Test.Setup.Common do
+ @moduledoc """
+ A set of common setup pipelines for reuse
+
+ - httpd_with_admin - chttpd is started and new admin is created
+ - httpd_with_db - httpd_with_admin and new database is created
+ """
+ alias Couch.Test.Setup.Step
+
+ def httpd_with_admin(setup) do
+ setup
+ |> Step.Start.new(:start, extra_apps: [:chttpd])
+ |> Step.User.new(:admin, roles: [:server_admin])
+ end
+
+ def httpd_with_db(setup) do
+ setup
+ |> httpd_with_admin()
+ |> Step.Create.DB.new(:db)
+ end
+
+ def with_db(setup) do
+ setup
+ |> Step.Start.new(:start, extra_apps: [:fabric])
+ |> Step.Create.DB.new(:db)
+ end
+end \ No newline at end of file