diff --git a/lib/koans/08_structs.ex b/lib/koans/08_structs.ex index 2831af3..4a7c178 100644 --- a/lib/koans/08_structs.ex +++ b/lib/koans/08_structs.ex @@ -5,6 +5,11 @@ defmodule Structs do defstruct [:name, :age ] end + koan "structs are defined and named after a module" do + person = %Person{} + assert person == :__ + end + koan "you can access the fields of a struct" do nobody = %Person{} assert nobody.age == :__ diff --git a/test/koans_harness_test.exs b/test/koans_harness_test.exs index bc42895..7d9df22 100644 --- a/test/koans_harness_test.exs +++ b/test/koans_harness_test.exs @@ -151,6 +151,7 @@ defmodule KoansHarnessTest do test "Structs" do answers = [ + %Structs.Person{}, nil, "Joe", 33,