From 45893b3f816605823b1529c1102dcb4140a85bec Mon Sep 17 00:00:00 2001 From: Arnaud Wetzel Date: Sun, 5 Jul 2015 02:20:28 +0200 Subject: [PATCH] test that an exception is throwed on decode! fail --- test/hashids_test.exs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/hashids_test.exs b/test/hashids_test.exs index 47aba95..21b04d2 100644 --- a/test/hashids_test.exs +++ b/test/hashids_test.exs @@ -19,4 +19,10 @@ defmodule HashidsTest.Encode do testcase_from_fixture_large "min_length_20_large" testcase_from_fixture_large "short_alphabet_large" testcase_from_fixture_large "long_alphabet_large" + + test "decode! fail throws exception" do + assert_raise Hashids.DecodingError, fn-> + Hashids.decode!(Hashids.new,"%%%%%") + end + end end