Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Plug.Adapters.Test.Conn tests #1235

Merged

Conversation

thymusvulgaris
Copy link
Contributor

  • Add Plug.Adapters.Test.Conn.conn/4 test cases for params that have a struct or function value.

  • Add test that asserts Plug.Adapters.Test.Conn.conn/4 writes a message to stderr when the URI path does not start with forward slash.

  • Add test that asserts Plug.Adapters.Test.Conn.push/3 sends message including path and headers.

* Add Plug.Adapters.Test.Conn.conn/4 test cases for params that
  have a struct or function value.

* Add test that asserts Plug.Adapters.Test.Conn.conn/4 writes a
  message to stderr when the URI path does not start with forward
  slash.

* Add test that asserts Plug.Adapters.Test.Conn.push/3 sends
  message including path and headers.
@thymusvulgaris
Copy link
Contributor Author

I haven't included the following test.

+++ b/test/plug/adapters/test/conn_test.exs
@@ -7,6 +7,7 @@ defmodule Plug.Adapters.Test.ConnTest do
     conn = conn(:get, "/", "abcdefghij")
     {adapter, state} = conn.adapter
 
+    assert {:ok, "abcdefghij", _state} = adapter.read_req_body(state)

A binary larger than the default length would make for a better test, but that would be a very large binary.

@josevalim josevalim merged commit b9af901 into elixir-plug:main Jun 25, 2024
2 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants