Skip to content

Commit

Permalink
delete test for tips
Browse files Browse the repository at this point in the history
  • Loading branch information
mnishiguchi committed Nov 30, 2023
1 parent 2987072 commit 88c5041
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
3 changes: 1 addition & 2 deletions lib/nerves_motd.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down
21 changes: 0 additions & 21 deletions test/nerves_motd_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 88c5041

Please sign in to comment.