• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

akira / exq / 16bf7540e38e434e6ed4fadc1f40894960dd12db-PR-500

07 Aug 2025 11:50AM UTC coverage: 90.805% (-1.6%) from 92.382%
16bf7540e38e434e6ed4fadc1f40894960dd12db-PR-500

Pull #500

github

ananthakumaran
Run coveralls on one build only
Pull Request #500: Add ability to snooze job

15 of 15 new or added lines in 2 files covered. (100.0%)

18 existing lines in 13 files now uncovered.

1195 of 1316 relevant lines covered (90.81%)

706.93 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/lib/exq/support/coercion.ex
1
defmodule Exq.Support.Coercion do
2
  @moduledoc false
3

4
  def to_integer(value) when is_integer(value) do
5
    value
1,277✔
6
  end
7

8
  def to_integer(binary) when is_binary(binary) do
9
    binary
10
    |> Integer.parse()
11
    |> case do
1,320✔
12
      {integer, ""} ->
13
        integer
1,319✔
14

15
      _ ->
16
        raise ArgumentError,
1✔
17
          message: "Failed to parse #{inspect(binary)} into an integer."
18
    end
19
  end
20

21
  def to_integer(value) do
22
    raise ArgumentError,
×
23
      message: "Failed to parse #{inspect(value)} into an integer."
24
  end
25

26
  def to_boolean(value) when is_boolean(value) do
27
    value
253✔
28
  end
29

30
  @true_values ["true", "yes", "1"]
31
  def to_boolean(value) when is_binary(value) do
32
    case value |> String.trim() |> String.downcase() do
1✔
33
      x when x in @true_values -> true
1✔
UNCOV
34
      _ -> false
×
35
    end
36
  end
37

38
  def to_boolean(value) do
39
    raise ArgumentError,
×
40
      message: "Failed to parse #{inspect(value)} into a boolean."
41
  end
42

43
  def to_module(class) when is_atom(class) do
44
    to_module(to_string(class))
7✔
45
  end
46

47
  def to_module("Elixir." <> class) do
48
    to_module(class)
7✔
49
  end
50

51
  def to_module(class) do
52
    target = String.replace(class, "::", ".")
1,339✔
53
    [mod | _func_or_empty] = Regex.split(~r/\//, target)
1,339✔
54
    String.to_atom("Elixir.#{mod}")
1,339✔
55
  end
56
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc