Enable unaliased modules ex_slop check

This commit is contained in:
Claudio Ortolina
2026-04-22 20:36:13 +01:00
parent 5c1beede53
commit f7f38d580e
26 changed files with 226 additions and 193 deletions
@@ -3,6 +3,7 @@ defmodule MusicLibrary.Chats.ArtistChatTest do
alias MusicLibrary.Artists.{Artist, ArtistInfo}
alias MusicLibrary.Chats.ArtistChat
alias Plug.Conn
defp build_artist(attrs \\ %{}) do
defaults = %{
@@ -44,13 +45,13 @@ defmodule MusicLibrary.Chats.ArtistChatTest do
defp stub_and_capture_instructions(test_pid) do
Req.Test.stub(OpenAI.API, fn conn ->
{:ok, body, conn} = Plug.Conn.read_body(conn)
{:ok, body, conn} = Conn.read_body(conn)
request = JSON.decode!(body)
send(test_pid, {:captured_instructions, request["instructions"]})
conn
|> Plug.Conn.put_resp_content_type("text/event-stream")
|> Plug.Conn.send_resp(200, completed_response())
|> Conn.put_resp_content_type("text/event-stream")
|> Conn.send_resp(200, completed_response())
end)
end
@@ -2,6 +2,7 @@ defmodule MusicLibrary.Chats.CollectionChatTest do
use ExUnit.Case
alias MusicLibrary.Chats.CollectionChat
alias Plug.Conn
defp sse_event(type, data) do
json = JSON.encode!(%{type: type, delta: data})
@@ -15,13 +16,13 @@ defmodule MusicLibrary.Chats.CollectionChatTest do
defp stub_and_capture_instructions(test_pid) do
Req.Test.stub(OpenAI.API, fn conn ->
{:ok, body, conn} = Plug.Conn.read_body(conn)
{:ok, body, conn} = Conn.read_body(conn)
request = JSON.decode!(body)
send(test_pid, {:captured_instructions, request["instructions"]})
conn
|> Plug.Conn.put_resp_content_type("text/event-stream")
|> Plug.Conn.send_resp(200, completed_response())
|> Conn.put_resp_content_type("text/event-stream")
|> Conn.send_resp(200, completed_response())
end)
end
@@ -4,6 +4,7 @@ defmodule MusicLibrary.Chats.RecordChatTest do
alias MusicLibrary.Artists.Artist
alias MusicLibrary.Chats.RecordChat
alias MusicLibrary.Records.Record
alias Plug.Conn
defp build_record(attrs \\ %{}) do
defaults = %{
@@ -36,13 +37,13 @@ defmodule MusicLibrary.Chats.RecordChatTest do
defp stub_and_capture_instructions(test_pid) do
Req.Test.stub(OpenAI.API, fn conn ->
{:ok, body, conn} = Plug.Conn.read_body(conn)
{:ok, body, conn} = Conn.read_body(conn)
request = JSON.decode!(body)
send(test_pid, {:captured_instructions, request["instructions"]})
conn
|> Plug.Conn.put_resp_content_type("text/event-stream")
|> Plug.Conn.send_resp(200, completed_response())
|> Conn.put_resp_content_type("text/event-stream")
|> Conn.send_resp(200, completed_response())
end)
end