From e4d1cad6dfa674f1c41bd99faa9b3a2be2779eea Mon Sep 17 00:00:00 2001 From: Felipe Sere Date: Wed, 16 Mar 2016 21:55:19 +0000 Subject: [PATCH] Refernece the Person struct from test harness --- lib/koans/08_structs.ex | 5 +++++ test/koans_harness_test.exs | 1 + 2 files changed, 6 insertions(+) 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,