Skip to content

Commit

Permalink
Split out happy path part of skipped test
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerWitt committed Jan 13, 2025
1 parent 2429e2f commit 27ad0dc
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions test/postgrex_test.exs
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
defmodule PostgrexTest do
use ExUnit.Case, async: false
import ExUnit.CaptureLog, warn: false

# This test fails due to a bug betweem Elixir and Erlang in earlier versions of Elixir.
if Version.match?(Version.parse!(System.version()), Version.parse_requirement!(">= 1.17.2")) do
import ExUnit.CaptureLog
test "start_link/2 sets search path" do
search_path = ["public", "extension"]
{:ok, conn} = Postgrex.start_link(database: "postgrex_test", search_path: search_path)
%{rows: [[result]]} = Postgrex.query!(conn, "show search_path", [])

test "start_link/2 sets search path" do
# valid argument
search_path = ["public", "extension"]
{:ok, conn} = Postgrex.start_link(database: "postgrex_test", search_path: search_path)
%{rows: [[result]]} = Postgrex.query!(conn, "show search_path", [])
assert result == Enum.join(search_path, ", ")
assert result == Enum.join(search_path, ", ")
end

# This test fails due to a bug betweem Elixir and Erlang in earlier versions of Elixir.
if Version.match?(Version.parse!(System.version()), Version.parse_requirement!(">= 1.17.2")) do
test "start_link/2 detects invalid search path" do
# invalid argument
Process.flag(:trap_exit, true)
search_path = "public, extension"
Expand Down

0 comments on commit 27ad0dc

Please sign in to comment.