O'Reilly logo

Programming Phoenix by Jose Valim, Bruce Tate, Chris McCord

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing the Information System

We’ll start with perhaps our most significant testing challenge. We have quite a bit of behavior to cover, such as timeouts and forced backend termination. You’ll be surprised at how quickly we can cover all this functionality with a few short and sweet test cases. Let’s get started.

A natural first step for testing our InfoSys is to simply look for successful results. Replace your rumbrella/apps/info_sys/test/info_sys_test.exs with the following code:

1: defmodule​ InfoSysTest ​do
use​ ExUnit.Case
alias InfoSys.Result
5: defmodule​ TestBackend ​do
def​ start_link(query, ref, owner, limit) ​do
Task.start_link(__MODULE__, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required