Skip to content

Instantly share code, notes, and snippets.

@adkron
Created January 22, 2018 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adkron/783d084e5d92432cc2597c8ae01d364b to your computer and use it in GitHub Desktop.
Save adkron/783d084e5d92432cc2597c8ae01d364b to your computer and use it in GitHub Desktop.
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