Skip to content

Commit

Permalink
fix: Remove argumentError doctest
Browse files Browse the repository at this point in the history
Attempted to run the original code, and tried this as well but the argument error is still propagated to the livebook, and kills compilation.

```elixir
  iex> assert_raise ArgumentError, fn -> %Character{} end
  :ok
```
  • Loading branch information
jonathanstiansen authored Apr 9, 2024
1 parent b5ae5cf commit 78fb6ca
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions exercises/rpg_dialogue.livemd
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,10 @@ defmodule Character do
Defines a character struct, and functions for creating character dialogue.
iex> %Character{name: "Frodo"}
%Character{name: "Frodo", weapon: nil, class: nil}
iex> %Character{name: "Frodo", weapon: "Sting"}
%Character{name: "Frodo", weapon: "String", class: nil}
The :name key is required.
iex> %Character{name: "Frodo"}
** (ArgumentError) the following keys must also be given when building struct Character: [:name]
The :name key is required. But cannot be tested by doctests
"""
defstruct []

Expand Down

0 comments on commit 78fb6ca

Please sign in to comment.