Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
defmodule StructureOn.DCE.Connection.Watcher.Test do
use ExUnit.Case, async: true
use ExUnitProperties
alias StructureOn.DCE.Connection.Watcher, as: Subject
alias StructureOn.DCE.Connection.Supervisor
property "new addresses create new Connections" do
check all addresses <- unique_list_of(String.printable()),
max_runs: 50 do
for address <- addresses do
%{active: before_children} = Supervisor.which_children Supervisor
EventDispatcher.dispatch :e_struxure_on_server_added, address
%{active: after_children} = Supervisor.which_children Supervisor
assert after_children == before_children + 1
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment