remove duplication of struct defaults
This commit is contained in:
@@ -43,12 +43,12 @@ defmodule Structs do
|
||||
end
|
||||
|
||||
koan "Use the put_in macro to replace a nested value" do
|
||||
airline = %Airline{plane: %Plane{maker: :boeing}}
|
||||
airline = %Airline{}
|
||||
assert put_in(airline.plane.maker, :airbus) == ___
|
||||
end
|
||||
|
||||
koan "Use the update_in macro to modify a nested value" do
|
||||
airline = %Airline{plane: %Plane{maker: :boeing, passengers: 200}}
|
||||
airline = %Airline{plane: %Plane{passengers: 200}}
|
||||
assert update_in(airline.plane.passengers, fn x -> x + 2 end) == ___
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user