DockYard-Academy / curriculum

MIT License
945 stars 245 forks source link

fix: Remove argumentError doctest #1057

Closed jonathanstiansen closed 4 months ago

jonathanstiansen commented 5 months ago

First, the test itself should work because the character has a :name, so I can't get that test to "pass". When changing it so it does throw an error, the whole liveview process throws an error:

image

Options I attempted:

  1. I tried the original with no name passed to the struct
  2. I tried using assert_raise with the third param, including the message but isn't required and made the test long (and still failed)
  3. I tried to use assert_raise as well but the argument error is still propagated to the livebook, and kills compilation.
  iex> assert_raise ArgumentError, fn -> %Character{} end
  :ok
BrooklinJazz commented 4 months ago

There's a CI issue I should be able to fix fairly easily when I have time. Since it is an improvement, I'm going to merge this in. Thank you, @jonathanstiansen, for the catch!