Skip to content

Commit

Permalink
Add test for Inspect.Portal, not sure why 2 lines not tested
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelowens committed Apr 24, 2015
1 parent 33d9f6c commit 9cb89ed
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions test/portal_test.exs
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

0 comments on commit 9cb89ed

Please sign in to comment.