prestige v1.0.1 Prestige.Case View Source
ExUnit Case that will auto create and drop tables around the entire file and create and rollback transactions around each test.
Example:
defmodule Prestige.CaseTest do
use Prestige.Case
session url: "http://localhost:8080", user: "bbalser", catalog: "hive", schema: "default"
table "people", %{
"name" => "varchar",
"age" => "int"
}
test "transaction that will be rolled back automatically", %{session: session} do
Prestige.query!(session, "insert into people(name, age) values('Brian', 21)")
assert [%{"name" => "Brian"}] == Prestige.query!(session, "select name from people") |> Prestige.Result.as_maps()
end
end