初学者向けです。ExUnitというテストフレームワークがあることは知っているけれど、使い方はあんまり分かっていない、という方を対象に書きます。 テストを書く 基本の流れ # my_module_test.exs ExUnit.start defmodule MyApp.MyModuleTest do use ExUnit.Case, async: true test "the truth" do assert 1 + 1 == 2 end end はじめにExUnit.startで:ex_unitを起動します。通常のMixプロジェクトでは、プロジェクト作成時に生成されるtest/test_helper.exsでこれが行われるので、自分で書くことは少ないでしょう。 次にテストモジュールを定義します。モジュール名は重複しなければ何でもOKですが、ファイル名は_test.exsで終わる必要がある
Full-stack Infrastructure Engineer who is in love with Elixir and a bit obsessed with metrics. Blogger, open source tinkerer, and occasional tweeter. Introduction Every language needs a solid test framework, and that framework needs to provide mechanisms that allow a developer to exercise the features of the language. To that end, Elixir comes bundled with ExUnit to allow developers to make use of
When writing code it is good to keep in mind the perspective of the next programmer who will read it, be that yourself or someone else, be that tomorrow or in six months time. The Elixir/Erlang community has created a variety of tools to improve code maintainability and readability. In this blog I will be showing you how to use four essential tools and also giving my views on them. A note before I
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く