Last active
November 29, 2016 01:56
-
-
Save robotarmy/ad6d13fcf76f97ab35a82262667896b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule TypeiTest do | |
use ExUnit.Case | |
doctest Typei | |
# declare type that is made up of other types | |
@type payment :: %Payment{ # Payment is a ...? Record?? Struct??) | |
invalid_at :: DateTime.t, # DateTime specifically tied to ... ? Module?? | |
admin_removed_at :: DateTime.t, | |
removed_at :: DateTime.t, | |
ready_at :: DateTime.t, | |
payout_at :: DateTime.t, | |
created_at :: DateTime.t, | |
id :: number # float or int (vague) | |
} | |
test "the truth" do | |
payment = %Payment{} # need to make empty by using ... ? %Payment{}?? | |
payment.last_event = "ready" | |
assert payment.last_event = "ready" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the correct syntax for declaring a type?