Calendar.ESpec
Installation
The package can be installed
by adding calendar_espec to your list of dependencies in mix.exs:
def deps do
[
{:calendar_espec, "~> 0.1.0", only: :test}
]
endExample
defmodule Calendar.ESpec.Assertions.BeTimedSpec do
use ESpec, async: true
use Calendar.ESpec
describe "Verifying a date" do
it "checks a date`" do
expect(~D[2017-01-01]).to be_timed :before, ~D[2017-01-02]
end
it "checks a date close to`" do
expect(~D[2017-01-01]).to be_timed_close_to, ~D[2017-01-02], [weeks: 1, days: 1]
end
end
endDocumentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/calendar_espec.