ex_spec alternatives and similar packages
Based on the "Testing" category.
Alternatively, view ex_spec alternatives based on common mentions on social networks and blogs.
-
proper
PropEr: a QuickCheck-inspired property-based testing tool for Erlang -
bypass
Bypass provides a quick way to create a custom plug that can be put in place instead of an actual HTTP server to return prebaked responses to client requests. -
StreamData
Data generation and property-based testing for Elixir. ๐ฎ -
amrita
A polite, well mannered and thoroughly upstanding testing framework for Elixir -
power_assert
Power Assert in Elixir. Shows evaluation results each expression. -
shouldi
Elixir testing libraries with nested contexts, superior readability, and ease of use -
katt
KATT (Klarna API Testing Tool) is an HTTP-based API testing tool for Erlang. -
FakeServer
FakeServer integrates with ExUnit to make external APIs testing simpler -
Stubr
Stubr is a set of functions helping people to create stubs and spies in Elixir. -
mix_test_interactive
Interactive watch mode for Elixir's mix test. https://hexdocs.pm/mix_test_interactive/ -
mecks_unit
A simple Elixir package to elegantly mock module functions within (asynchronous) ExUnit tests using Erlang's :meck library -
test_selector
Elixir library to help selecting the right elements in your tests. -
factory_girl_elixir
Minimal implementation of Ruby's factory_girl in Elixir. -
toxiproxy_ex
ToxiproxyEx is an Elixir API client for the resilience testing tool Toxiproxy. -
ex_parameterized
This library support parameterized test with test_with_params macro. -
cobertura_cover
Output test coverage information in Cobertura-compatible format -
ex_unit_fixtures
A library for defining modular dependencies (fixtures) for ExUnit tests.
Free Global Payroll designed for tech teams
Do you think we are missing an alternative of ex_spec or a related project?
README
ExSpec
ExSpec is a simple wrapper around ExUnit that adds Rspec-style macros. Specifically, it adds context
and it
.
While it takes inspiration from Rspec, ExSpec is significantly simplier. The context
macro has only two functions:
- Aid test organization
- Prepend to the message of any
it
defined within its do blocks
The it
macro is identical to ExUnit.Case.test
except that it is aware of the messages of its surrounding context
blocks. It also works seemlessly with ExUnit
's describe
function.
Other than the functionality described above, ExSpec is just ExUnit. When use
ing ExSpec
, any options provided will be passed to ExUnit.Case
(e.g. async: true
).
A simple example is shown below. For more examples, see the tests.
Example
defmodule PersonTest do
use ExSpec, async: true
describe "name" do
context "with first and last name" do
it "joins the names with a space" do
drew = %Person{first_name: "Drew", last_name: "Olson"}
assert Person.name(drew) == "Drew Olson"
end
end
context "with only a first name" do
it "returns the first name" do
drew = %Person{first_name: "Drew", last_name: nil}
assert Person.name(drew) == "Drew"
end
end
end
end
Installation
Add ex_spec
to your mix.exs
dependencies:
def deps do
[{:ex_spec, "~> 2.0", only: :test}]
end