-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for Inspect.Portal, not sure why 2 lines not tested
- Loading branch information
1 parent
33d9f6c
commit 9cb89ed
Showing
1 changed file
with
14 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
defmodule PortalTest do | ||
use ExUnit.Case | ||
|
||
setup do | ||
Portal.shoot(:orange) | ||
Portal.shoot(:blue) | ||
:ok | ||
""" | ||
#Portal< | ||
:orange <=> :blue | ||
[1, 2, 3, 4] <=> [] | ||
> | ||
""" | ||
test "Custom Portal inspector" do | ||
Portal.Door.start_link(:red) | ||
Portal.Door.start_link(:green) | ||
portal = Portal.transfer(:red, :green, [1,2,3,4]) | ||
assert Regex.match?(~r/^#Portal<\n(.+?) <=> (.+?)\n(.+?) <=> (.+?)\n>$/m, inspect(portal)) | ||
end | ||
|
||
test "Portal exist" do | ||
test "Can push data between portals" do | ||
Portal.shoot(:orange) | ||
Portal.shoot(:blue) | ||
portal = Portal.transfer(:orange, :blue, [1,2,3,4]) | ||
Portal.push_right(portal) | ||
assert Portal.Door.get(:orange) == [3,2,1] | ||
assert Portal.Door.get(:blue) == [4] | ||
assert 1 + 1 == 2 | ||
end | ||
|
||
# test "Portal exist again", context do | ||
# assert 1 + 3 == 2 | ||
# end | ||
end |