diff --git a/lib/nerves_motd.ex b/lib/nerves_motd.ex index bdef86f..4e853da 100644 --- a/lib/nerves_motd.ex +++ b/lib/nerves_motd.ex @@ -67,7 +67,6 @@ defmodule NervesMOTD do Enum.map(rows(apps, combined_opts), &format_row/1), "\n", fortune(opts), - "\n" ] |> IO.ANSI.format() |> IO.puts() @@ -88,7 +87,7 @@ defmodule NervesMOTD do @spec fortune([option()]) :: IO.ANSI.ansidata() defp fortune(opts) do if opts[:fortune] do - Fortune.random!() + [Fortune.random!(), "n"] else [] end diff --git a/test/nerves_motd_test.exs b/test/nerves_motd_test.exs index f74ae4f..508e9e1 100644 --- a/test/nerves_motd_test.exs +++ b/test/nerves_motd_test.exs @@ -348,25 +348,4 @@ defmodule NervesMOTDTest do assert capture_motd() == "" end - - describe "fortune" do - setup _context do - NervesMOTD.MockRuntime - |> Mox.expect(:applications, 1, default_applications_code()) - |> Mox.expect(:active_partition, 1, fn -> "A" end) - |> Mox.expect(:firmware_validity, 1, fn -> :valid end) - - :ok - end - - @fortune_regex ~r/\n---*\n.*\n---*\n/ - - test "does not show fortune by default" do - refute capture_motd() =~ @fortune_regex - end - - test "shows fortune when enabled" do - assert capture_motd(fortune: true) =~ @fortune_regex - end - end end