Skip to Main Content
Programming Phoenix
book

Programming Phoenix

by Chris McCord, Bruce Tate, Jose Valim
April 2016
Beginner to intermediate content levelBeginner to intermediate
300 pages
6h 58m
English
Pragmatic Bookshelf
Content preview from Programming Phoenix

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__, ...
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.
Start your free trial

You might also like

Programming Elm

Programming Elm

Jeremy Fairbank
Real-Time Phoenix

Real-Time Phoenix

Stephen Bussey

Publisher Resources

ISBN: 9781680501926Errata Page