Skip to content

Commit a4166f1

Browse files
brienwrjanja
authored andcommitted
Fix config file locations and clean up test warnings (#217)
1 parent 3bad31d commit a4166f1

File tree

8 files changed

+12
-14
lines changed

8 files changed

+12
-14
lines changed

config/config.exs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# This file is responsible for configuring your application
22
# and its dependencies with the aid of the Mix.Config module.
33
use Mix.Config
4-
import_config "#{Mix.env}.exs"
File renamed without changes.
File renamed without changes.

config/deploy/test.exs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use Mix.Config

config/test.exs

-8
This file was deleted.

lib/bootleg/config.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ defmodule Bootleg.Config do
111111
```
112112
use Bootleg.Config
113113
config :foo, :bar
114-
114+
115115
# local_foo will be :bar
116116
local_foo = config :foo
117117

test/bootleg/config/agent_test.exs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
defmodule Bootleg.Config.AgentTest do
22
use Bootleg.TestCase, async: false
33
alias Bootleg.Config.Agent
4+
import ExUnit.CaptureIO
45

56
test "stores values for retrieval" do
67
{:ok, _} = Agent.start_link
@@ -29,7 +30,9 @@ defmodule Bootleg.Config.AgentTest do
2930
end
3031

3132
test "start_link/1 sets the environment to the provided env" do
32-
Agent.start_link(:bar)
33+
capture_io(fn ->
34+
Agent.start_link(:bar)
35+
end)
3336
assert Agent.get(:config) == [env: :bar]
3437
end
3538
end

test/bootleg/config_test.exs

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ defmodule Bootleg.ConfigTest do
33
alias Bootleg.{Config, UI, SSH}
44
alias Config.Agent
55
alias Mix.Project
6+
import ExUnit.CaptureIO
67
import Mock
78

89
doctest Bootleg.Config
@@ -216,13 +217,15 @@ defmodule Bootleg.ConfigTest do
216217
end
217218

218219
test "env/1" do
219-
Config.env(:bar)
220+
capture_io(fn ->
221+
Config.env(:bar)
222+
end)
220223
assert :bar == Config.env
221224
end
222225

223226
test_with_mock "env/1 starts the agent", Agent, [:passthrough], [] do
224-
Config.env(:bar)
225-
assert called Agent.start_link(:bar)
227+
Config.env(:test)
228+
assert called Agent.start_link(:test)
226229
end
227230

228231
test "invoke/1" do

0 commit comments

Comments
 (0)