Interactively check Plug.Conn behaviour

This might be completely obvious for seasoned Elixirians (even like - you can’t do this obviously!) so bear with me please. I would like to interactively test behaviour of Plug.Conn.delete_session/2 Is there a way to do it from iex started Phoenix application environment?

You can always use Plug.Test.conn/3 to create test Plug.Conn.t/0 instance (however beware that there is no way to create HTTP/2 conn that way).

I see - that seems to be enough though as after init_test_session/2 I was able to use the Plug.Conn functions this way and I assume (please correct me if I am wrong) that they should behave the same. Namely I wanted to check what happens if I delete_session/2 when the key is not present. Seems that there is no exception in such case.

By looking at the code for Plug.Conn.delete_session/2 here, it does look like it just returns the map unchanged when the key is not there, as it uses Map.delete/2 and that’s its documented behavior.

Yes - thank you.