summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Doane <jaydoane@apache.org>2019-12-11 11:59:26 -0800
committerJay Doane <jaydoane@apache.org>2019-12-17 09:13:00 -0800
commite3842215159840a2cf45780221c07d1b3d1811a3 (patch)
tree30632bbe3a4da73d5eedfb4999de6a7647636568
parent831f78eb0745018701f340267647dce33e3904aa (diff)
downloadcouchdb-e3842215159840a2cf45780221c07d1b3d1811a3.tar.gz
Fix exunit compiler warnings
This suppresses the following warnings emitted during `make exunit`: ``` ==> couchdbtest Compiling 12 files (.ex) warning: variable "config_file" is unused (if the variable is not meant to be used, prefix it with an underscore) test/elixir/lib/step/config.ex:15 warning: variable "setup" is unused (if the variable is not meant to be used, prefix it with an underscore) test/elixir/lib/step/create_db.ex:44 warning: variable "step" is unused (if the variable is not meant to be used, prefix it with an underscore) test/elixir/lib/step/create_db.ex:44 warning: variable "setup" is unused (if the variable is not meant to be used, prefix it with an underscore) test/elixir/lib/step/user.ex:35 warning: variable "setup" is unused (if the variable is not meant to be used, prefix it with an underscore) test/elixir/lib/step/user.ex:78 warning: variable "step" is unused (if the variable is not meant to be used, prefix it with an underscore) test/elixir/lib/step/user.ex:78 warning: unused import ExUnit.Assertions.assert/1 test/elixir/lib/step/create_db.ex:22 warning: unused alias Step test/elixir/lib/step/user.ex:18 ```
-rw-r--r--test/elixir/lib/step/config.ex4
-rw-r--r--test/elixir/lib/step/create_db.ex6
-rw-r--r--test/elixir/lib/step/user.ex7
3 files changed, 8 insertions, 9 deletions
diff --git a/test/elixir/lib/step/config.ex b/test/elixir/lib/step/config.ex
index 9d9ac8eab..41d559908 100644
--- a/test/elixir/lib/step/config.ex
+++ b/test/elixir/lib/step/config.ex
@@ -12,7 +12,7 @@ defmodule Couch.Test.Setup.Step.Config do
setup |> Setup.step(id, %__MODULE__{config_file: config_file})
end
- def setup(_setup, %__MODULE__{config_file: config_file} = step) do
+ def setup(_setup, %__MODULE__{config_file: _config_file} = step) do
# TODO we would need to access config file here
%{step | config: %{
backdoor: %{
@@ -30,4 +30,4 @@ defmodule Couch.Test.Setup.Step.Config do
def get(%__MODULE__{config: config}) do
config
end
-end \ No newline at end of file
+end
diff --git a/test/elixir/lib/step/create_db.ex b/test/elixir/lib/step/create_db.ex
index 3cca3c55a..d38e6722f 100644
--- a/test/elixir/lib/step/create_db.ex
+++ b/test/elixir/lib/step/create_db.ex
@@ -19,7 +19,7 @@ defmodule Couch.Test.Setup.Step.Create.DB do
defstruct [:name]
- import ExUnit.Assertions, only: [assert: 1, assert: 2]
+ import ExUnit.Assertions, only: [assert: 2]
import Utils
@@ -41,7 +41,7 @@ defmodule Couch.Test.Setup.Step.Create.DB do
step
end
- def teardown(setup, %__MODULE__{name: name} = step) do
+ def teardown(_setup, %__MODULE__{name: name} = _step) do
:fabric.delete_db(name, [@admin])
:ok
end
@@ -50,4 +50,4 @@ defmodule Couch.Test.Setup.Step.Create.DB do
name
end
-end \ No newline at end of file
+end
diff --git a/test/elixir/lib/step/user.ex b/test/elixir/lib/step/user.ex
index 5a1cab33c..63b8f4465 100644
--- a/test/elixir/lib/step/user.ex
+++ b/test/elixir/lib/step/user.ex
@@ -15,7 +15,6 @@ defmodule Couch.Test.Setup.Step.User do
"""
alias Couch.Test.Setup
- alias Couch.Test.Setup.Step
alias Couch.Test.Utils
import ExUnit.Callbacks, only: [on_exit: 1]
@@ -32,7 +31,7 @@ defmodule Couch.Test.Setup.Step.User do
setup |> Setup.step(id, %__MODULE__{roles: roles || []})
end
- def setup(setup, %__MODULE__{roles: roles} = step) do
+ def setup(_setup, %__MODULE__{roles: roles} = step) do
users_db = IO.chardata_to_string(
:config.get('chttpd_auth', 'authentication_db', '_users'))
if not Utils.db_exists?(users_db) do
@@ -75,7 +74,7 @@ defmodule Couch.Test.Setup.Step.User do
end
end
- def teardown(setup, %__MODULE__{name: name, users_db: users_db, roles: roles} = step) do
+ def teardown(_setup, %__MODULE__{name: name, users_db: users_db, roles: roles} = _step) do
if :server_admin in roles do
:config.delete("admins", String.to_charlist(name), false)
else
@@ -101,4 +100,4 @@ defmodule Couch.Test.Setup.Step.User do
{name, pass}
end
-end \ No newline at end of file
+end