Refernece the Person struct from test harness
This commit is contained in:
@@ -5,6 +5,11 @@ defmodule Structs do
|
|||||||
defstruct [:name, :age ]
|
defstruct [:name, :age ]
|
||||||
end
|
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
|
koan "you can access the fields of a struct" do
|
||||||
nobody = %Person{}
|
nobody = %Person{}
|
||||||
assert nobody.age == :__
|
assert nobody.age == :__
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ defmodule KoansHarnessTest do
|
|||||||
|
|
||||||
test "Structs" do
|
test "Structs" do
|
||||||
answers = [
|
answers = [
|
||||||
|
%Structs.Person{},
|
||||||
nil,
|
nil,
|
||||||
"Joe",
|
"Joe",
|
||||||
33,
|
33,
|
||||||
|
|||||||
Reference in New Issue
Block a user