Fix warnings on modern Elixir #8

Closed
feld wants to merge 0 commits from gitlab-mr-iid-7 into master
Owner
No description provided.
Author
Owner

Pipeline is failing because we have mix test --cover as our default test job and we aren't at 90% test coverage which is kinda silly because there's only 1 public function in this entire module

Pipeline is failing because we have `mix test --cover` as our default test job and we aren't at 90% test coverage which is kinda silly because there's only 1 public function in this entire module
Author
Owner

If the priv/captcha binary does not exist we raise an error, so the :error return will never happen.

I'm not aware of the captcha binary ever failing to return valid data.

We can just cheat and make it pass with 100% coverage with this ugly pipeline:

  def get() do
    Application.app_dir(:captcha, "priv/captcha")
    |> System.cmd([])
    |> (fn {<<text::bytes-size(5), img::binary>>, 0} ->
          {:ok, text, img}
        end).()
  end
If the `priv/captcha` binary does not exist we raise an error, so the :error return will never happen. I'm not aware of the `captcha` binary ever failing to return valid data. We can just cheat and make it pass with 100% coverage with this ugly pipeline: ``` def get() do Application.app_dir(:captcha, "priv/captcha") |> System.cmd([]) |> (fn {<<text::bytes-size(5), img::binary>>, 0} -> {:ok, text, img} end).() end ```

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma-elixir-libraries/elixir-captcha!8
No description provided.