Skip to content

Commit

Permalink
test Sigil Inspect (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
maennchen committed Jan 20, 2017
1 parent a6238d7 commit 4cf7925
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/crontab/cron_expression_test.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
defmodule Crontab.CronExpressionTest do
import Crontab.CronExpression

use ExUnit.Case, async: true
doctest Crontab.CronExpression, import: true

import ExUnit.CaptureIO

# I'd like to doctest that one, but I can't get the sigil working
# doctest Inspect.Crontab.CronExpression, import: true

test "sigil inspect" do
fun = fn ->
assert IO.inspect ~e[*]
end
assert capture_io(fun) == "~e[* * * * * *]\n"
end

test "extended sigil inspect" do
fun = fn ->
assert IO.inspect ~e[*]e
end
assert capture_io(fun) == "~e[* * * * * * *]e\n"
end
end

0 comments on commit 4cf7925

Please sign in to comment.