Use assert_raises in the tests

This commit is contained in:
Rafael Mendonça França
2012-03-06 14:35:58 -03:00
parent 87194f1836
commit 6710b2ba95
4 changed files with 20 additions and 22 deletions
+4 -4
View File
@@ -30,10 +30,10 @@ end
defmodule String::Chars::BitStringTest do
use ExUnit::Case
# TODO: Use flunk or assert_raises
test :bitstring do
assert_equal "<<0,1|4>>", to_binary(<<1|12-integer-signed>>)
rescue: FunctionClauseError
assert_raises FunctionClauseError, fn ->
to_binary(<<1|12-integer-signed>>)
end
end
test :binary do
@@ -71,4 +71,4 @@ defmodule String::Chars::ListTest do
test :empty do
assert_equal "", to_binary([])
end
end
end