Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Thal <467872+athal7@users.noreply.github.com>
  • Loading branch information
athal7 committed Jul 25, 2023
1 parent b812d88 commit 27a9ab8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use Mix.Config
import Config

env_config = Path.expand("#{Mix.env()}.exs", __DIR__)
env_config = Path.expand("#{config_env()}.exs", __DIR__)

if File.exists?(env_config) do
import_config(env_config)
Expand Down
6 changes: 3 additions & 3 deletions config/test.exs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use Mix.Config
import Config

config :logger, level: :warn
config :logger, level: :warning

config :dvr_phoenix, DVR.Phoenix.TestEndpoint,
url: [host: "localhost"],
root: Path.dirname(__DIR__),
secret_key_base: "GSGmIoMRxcLfHBfBhtD/Powy7WaucKbLuB7BTMt41nkm5xS+8LfnXZYNsk6qKOo1",
render_errors: [accepts: ~w(json)],
pubsub_server: DVR.Phoenix.PubSub
pubsub_server: DVR.Phoenix.PubSub
2 changes: 1 addition & 1 deletion lib/dvr/channel.ex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ defmodule DVR.Channel do
end
else
require Logger
Logger.warn("DVR Channel not configured, Phoenix.Channel module is not available")
Logger.warning("DVR Channel not configured, Phoenix.Channel module is not available")
end
end
end
12 changes: 6 additions & 6 deletions test/dvr/absinthe_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ defmodule DVR.AbsintheTest do
assert %{
"fooUpdates" => %{
"foo" => %{"bar" => "corge"},
"replayId" => id2
"replayId" => _
}
} = data

Expand All @@ -53,14 +53,14 @@ defmodule DVR.AbsintheTest do
assert %{
"fooUpdates" => %{
"foo" => %{"bar" => "corge"},
"replayId" => id2
"replayId" => _
}
} = data
end

test "resolves with the new doc on replay", %{socket: socket} do
ref = push_doc(socket, @subscription)
assert_reply(ref, :ok, %{subscriptionId: subscription_id})
assert_reply(ref, :ok, %{subscriptionId: _subscription_id})

publish(@endpoint, %{foo: %{bar: "qux"}}, foo_updates: "*")
assert_push("subscription:data", %{result: %{data: data}})
Expand All @@ -78,7 +78,7 @@ defmodule DVR.AbsintheTest do
assert %{
"fooUpdates" => %{
"foo" => %{"bar" => "corge"},
"replayId" => id2
"replayId" => _
}
} = data

Expand All @@ -100,7 +100,7 @@ defmodule DVR.AbsintheTest do
assert %{
"fooUpdates" => %{
"foo" => %{"bar" => "corge", "baz" => "grault"},
"replayId" => id2
"replayId" => _
}
} = data
end
Expand All @@ -120,6 +120,6 @@ defmodule DVR.AbsintheTest do
} = data

push(socket, "replay", %{"replayId" => 1, "subscriptionId" => subscription_id})
assert_push("replay:warning", %{"requestedReplayId" => 1, "earliestReplayId" => id})
assert_push("replay:warning", %{"requestedReplayId" => 1, "earliestReplayId" => ^id})
end
end
4 changes: 2 additions & 2 deletions test/dvr/channel_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defmodule DVR.PhoenixChannelTest do
assert_broadcast("phoenix", %{"hello" => "all", replay_id: id})

push(socket, "new_msg", %{"hello" => "some"})
assert_broadcast("phoenix", %{"hello" => "some", replay_id: id2})
assert_broadcast("phoenix", %{"hello" => "some", replay_id: _id2})

push(socket, "replay", %{"replay_id" => id})
assert_push("phoenix", %{"hello" => "some"})
Expand All @@ -28,6 +28,6 @@ defmodule DVR.PhoenixChannelTest do
assert_broadcast("phoenix", %{"hello" => "all", replay_id: id})

push(socket, "replay", %{"replay_id" => 1})
assert_push("replay:warning", %{"requested_replay_id" => 1, "earliest_replay_id" => id})
assert_push("replay:warning", %{"requested_replay_id" => 1, "earliest_replay_id" => ^id})
end
end

0 comments on commit 27a9ab8

Please sign in to comment.