diff --git a/test/xandra_test.exs b/test/xandra_test.exs index 57a9a4ff..22ccceb3 100644 --- a/test/xandra_test.exs +++ b/test/xandra_test.exs @@ -1,6 +1,8 @@ defmodule XandraTest do use ExUnit.Case, async: true + import XandraTest.IntegrationCase, only: [default_start_options: 0] + doctest Xandra describe "options validation in Xandra.start_link/1" do @@ -46,12 +48,12 @@ defmodule XandraTest do end test "supports DBConnection.status/1 without raising" do - conn = start_supervised!(Xandra) + conn = start_supervised!({Xandra, default_start_options()}) assert DBConnection.status(conn) == :idle end test "raises for unsupported DBConnection callbacks" do - conn = start_supervised!(Xandra) + conn = start_supervised!({Xandra, default_start_options()}) assert_raise ArgumentError, "Cassandra doesn't support transactions", fn -> assert DBConnection.transaction(conn, fn _ -> :ok end) @@ -60,12 +62,16 @@ defmodule XandraTest do @tag :capture_log test "rescues DBConnection errors" do - conn = - start_supervised!( - {Xandra, - nodes: ["nonexistent-domain"], queue_target: 10, queue_interval: 10, pool_size: 0} + options = + Keyword.merge(default_start_options(), + nodes: ["nonexistent-domain"], + queue_target: 10, + queue_interval: 10, + pool_size: 0 ) + conn = start_supervised!({Xandra, options}) + assert {:error, %DBConnection.ConnectionError{}} = Xandra.execute(conn, "USE some_keyspace") end end