In your first example,
- When
App.Repo.get(App.Room, 1)returnsnilit will still bindniltoroom. - Then
test_fn("good")will returntrueso that will also pass. - Lastly. it will execute
IO.inspect(room)and sinceroom == nilyou seenil.
From that explanation I think you can work out the second example. You might find some value in with room when not is_nil(room) <- App.Repo.get(App.Room, 1).






















