Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
unnawut committed Aug 25, 2019
1 parent 8352a67 commit 58b5273
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions test/mix/tasks/licenses_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@ defmodule Licensir.Mix.Tasks.LicensesTest do
end)

expected =
IO.ANSI.format([
IO.ANSI.format_fragment([
[:yellow, "Notice: This is not a legal advice. Use the information below at your own risk."], :reset, "\n",
"dep_license_undefined -> ", [:red, "Undefined"], :reset, "\n",
"dep_of_dep -> ", [:red, "Undefined"], :reset, "\n",
"dep_one_license -> ", [:green, "Licensir Mock License"], :reset, "\n",
"dep_one_unrecognized_license_file -> ", [:red, "Unrecognized license file content"], :reset, "\n",
"dep_two_conflicting_licenses -> ", [:yellow, "Unsure (found: License One, Licensir Mock License)"], :reset, "\n",
"dep_two_licenses -> ", [:green, "License Two, License Three"], :reset, "\n",
"dep_two_variants_same_license -> ", [:green, "Apache 2.0"], :reset, "\n",
"dep_with_dep -> ", [:red, "Undefined"], :reset, "\n"
"+-----------------------------------+---------+----------------------------------------------------+", "\n",
"| Package | Version | License |", "\n",
"+-----------------------------------+---------+----------------------------------------------------+", "\n",
"| dep_license_undefined | | Undefined |", "\n",
"| dep_of_dep | | Undefined |", "\n",
"| dep_one_license | | Licensir Mock License |", "\n",
"| dep_one_unrecognized_license_file | | Unrecognized license file content |", "\n",
"| dep_two_conflicting_licenses | | Unsure (found: License One, Licensir Mock License) |", "\n",
"| dep_two_licenses | | License Two, License Three |", "\n",
"| dep_two_variants_same_license | | Apache 2.0 |", "\n",
"| dep_with_dep | | Undefined |", "\n",
"+-----------------------------------+---------+----------------------------------------------------+", "\n", "\n"
])
|> to_string()
|> Kernel.<>("\n")

assert output == expected
end
Expand Down

0 comments on commit 58b5273

Please sign in to comment.