ESpec.DocTest (ESpec v1.10.0)
View SourceImplements functionality similar to ExUnit.DocTest. Provides doctest macro. Read the ExUnit.DocTest documentation for more info.
There are three types of specs: :test - examples where input and output can be evaluated: iex> Enum.map [1, 2, 3], fn(x) -> ...> x * 2 ...> end [2,4,6] Such examples will be converted to: 'expect(input).to eq(output)' assertion.
:inspect - examples which return complex structure so Elixir prints it as #Name<...>. iex> Enum.into([a: 10, b: 20], HashDict.new) #HashDict<[b: 20, a: 10]> The examples will be converted to: 'expect(inspect input).to eq(output)'.
:error - examples with exceptions: iex(1)> String.to_atom((fn() -> 1 end).()) ** (ArgumentError) argument error The examples will be converted to: expect(fn -> input end).to raise_exception(error_module, error_message).
Summary
Functions
Parses the module and builds 'specs'.