Calendar.ESpec

Build Status

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}
  ]
end

Example

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
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/calendar_espec.