Skip to content

Commit

Permalink
END-013 - Test for Endo.table_schema/0
Browse files Browse the repository at this point in the history
  • Loading branch information
vereis committed Jan 17, 2024
1 parent 8d2493e commit 9439d04
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/endo_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ defmodule EndoTest do
{:ok, find: fn tables, name -> Enum.find(tables, &(&1.name == name)) end}
end

describe "table_schema/0" do
test "returns specified table schema" do
# If configured, return the configured value
assert :ok = Application.put_env(:endo, :table_schema, "a_custom_schema_prefix")
assert "a_custom_schema_prefix" = Endo.table_schema()

# TODO: Otherwise fall back to "public" which is the default in Postgres at least --
# might need to investigate how we go about supporting this for future adapters.
assert :ok = Application.delete_env(:endo, :table_schema)
assert "public" = Endo.table_schema()
end
end

describe "list_tables/2" do
test "returns error when given non-ecto repo" do
assert_raise(
Expand Down

0 comments on commit 9439d04

Please sign in to comment.