Skip to content

Commit

Permalink
credo
Browse files Browse the repository at this point in the history
  • Loading branch information
angelikatyborska authored and andreasknoepfle committed Mar 22, 2024
1 parent 7b33738 commit 8d74258
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/bitstyles_phoenix/showcase.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ defmodule BitstylesPhoenix.Showcase do
doctest_expected_result_default_version
|> to_string()
|> String.split("\n")
|> Enum.map(&String.trim/1)
|> Enum.join("\n")
|> Enum.map_join("\n", &String.trim/1)

storydoc = """
## #{name}
Expand Down Expand Up @@ -140,17 +139,14 @@ defmodule BitstylesPhoenix.Showcase do
# when generating docs, we want to only to show the snippets for the default version
if Mix.env() === :test do
doctest_expected_results
|> Enum.map(fn {version, expected_result} ->
|> Enum.map_join("\n\n", fn {version, expected_result} ->
"""
iex> Application.put_env(:bitstyles_phoenix, :bitstyles_version, "#{version}")
#{doctest_iex_code |> String.replace("iex>", "...>")}
#{expected_result}
"""
end)
|> Enum.join("\n\n")
else
[{default_version, Keyword.get(doctest_expected_results, default_version)}]

"""
#{doctest_iex_code}
#{Keyword.get(doctest_expected_results, default_version)}
Expand Down

0 comments on commit 8d74258

Please sign in to comment.