Skip to content

Commit 1b77d2e

Browse files
committed
Fix warnings about undefined functions
``` warning: :fabric.get_db_info/1 is undefined (module :fabric is not available or is yet to be defined) │ 26 │ :fabric.get_db_info(db_name) │ ~ │ └─ test/elixir/lib/utils.ex:26:15: Couch.Test.Utils.db_exists?/1 both :extra_applications and :applications was found in your mix.exs. You most likely want to remove the :applications key, as all applications are derived from your dependencies ```
1 parent 780b488 commit 1b77d2e

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

mix.exs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,7 @@ defmodule CouchDBTest.Mixfile do
7171
end
7272

7373
# Run "mix help compile.app" to learn about applications.
74-
def application do
75-
[
76-
extra_applications: [:logger],
77-
applications: [:httpotion]
78-
]
79-
end
74+
def application, do: [applications: [:logger, :httpotion]]
8075

8176
# Specifies which paths to compile per environment.
8277
defp elixirc_paths(:test), do: ["test/elixir/lib", "test/elixir/test/support"]
@@ -85,20 +80,27 @@ defmodule CouchDBTest.Mixfile do
8580

8681
# Run "mix help deps" to learn about dependencies.
8782
defp deps() do
88-
deps_list = [
83+
deps1 = [
8984
{:junit_formatter, "~> 3.0", only: [:dev, :test, :integration]},
9085
{:httpotion, ">= 3.1.3", only: [:dev, :test, :integration], runtime: false},
9186
{:excoveralls, "~> 0.12", only: :test},
92-
{:b64url, path: path("b64url")},
93-
{:jiffy, path: path("jiffy")},
94-
{:jwtf, path: path("jwtf")},
9587
{:ibrowse, path: path("ibrowse"), override: true},
9688
{:credo, "~> 1.7.7", only: [:dev, :test, :integration], runtime: false}
9789
]
9890

91+
extra_deps = [:b64url, :jiffy, :jwtf, :meck, :mochiweb]
92+
deps2 = Enum.map(extra_deps, &{&1, path: path(&1)})
93+
94+
deps_list = deps1 ++ deps2
95+
96+
[:config, :couch, :fabric]
97+
|> Enum.map(&path("#{&1}/ebin"))
98+
|> Enum.map(&String.to_charlist/1)
99+
|> Enum.each(&:code.add_patha/1)
100+
99101
# Some deps may be missing during source check
100102
# Besides we don't want to spend time checking them anyway
101-
List.foldl([:b64url, :jiffy, :jwtf, :ibrowse], deps_list, fn dep, acc ->
103+
List.foldl([:ibrowse | extra_deps], deps_list, fn dep, acc ->
102104
if File.dir?(acc[dep][:path]) do
103105
acc
104106
else
@@ -107,10 +109,7 @@ defmodule CouchDBTest.Mixfile do
107109
end)
108110
end
109111

110-
defp path(app) do
111-
lib_dir = Path.expand("src", __DIR__)
112-
Path.expand(app, lib_dir)
113-
end
112+
defp path(app), do: Path.expand("src/#{app}", __DIR__)
114113

115114
def get_test_paths(:test) do
116115
Path.wildcard("src/*/test/exunit") |> Enum.filter(&File.dir?/1)
@@ -123,9 +122,7 @@ defmodule CouchDBTest.Mixfile do
123122
["test/elixir/test" | integration_tests]
124123
end
125124

126-
def get_test_paths(_) do
127-
[]
128-
end
125+
def get_test_paths(_), do: []
129126

130127
defp get_deps_paths() do
131128
deps = [

0 commit comments

Comments
 (0)