Create Your First Test
Tests can get complex when the code you’re testing includes dependencies or complex flows. So, we’ll start simple and work our way up to more complex testing cases. But first, let’s spend a little time comparing Ruby’s testing ideas to Elixir’s.
Ruby testing has historically been dominated by RSpec, but Minitest has made a resurgence in recent years. Minitest is rooted in providing a minimal set of assertions so that tests remain simple. RSpec rooted itself in a more comprehensive assertion library and has many options for setting up data.
Elixir’s testing framework—ExUnit—is included with the language. You don’t need to install anything to use it. In some languages, the built-in testing framework isn’t great, but ExUnit ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access