ObserverWeb.Macros (Observer Web v0.1.5)

This file contains common macros

Summary

Functions

Compiler macro that will only add the do block code if it is not a test build (prod or dev) and will run the else block of code if it is a test build

Functions

if_not_test(list)

(macro)
@spec if_not_test([{:do, any()} | {:else, any()}, ...]) :: any()

Compiler macro that will only add the do block code if it is not a test build (prod or dev) and will run the else block of code if it is a test build

Note: the else block is optional

Example:

import ObserverWeb.Macros

if_not_test do @msg "I am NOT a test build" else @msg "I am a test build" end