Skip to content

Commit

Permalink
just added a test
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertDober committed Dec 18, 2024
1 parent 4560f02 commit 19c1347
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule ExAequoColors.MixProject do
use Mix.Project
@version "0.1.2"
@version "0.1.3"
@url "https://github.com/RobertDober/ex_aequo_colors"

def project do
Expand Down
15 changes: 14 additions & 1 deletion test/ex_aequo_colors/puts_col_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Test.ExAequoColors.PutsColTest do

import ExAequoColors, only: [puts_col: 1, puts_col: 2]

describe "puts_col" do
describe "puts_col, a string" do
test "it puts colorized to stdout" do
output = capture_io(fn ->
puts_col("<bold>hello")
Expand All @@ -19,5 +19,18 @@ defmodule Test.ExAequoColors.PutsColTest do
end
end

describe "puts_col, a list" do
test "it puts to stdout" do
lines = [
"<bold>important",
"<dim>not so much",
]
output = capture_io(fn ->
puts_col(lines)
end)
assert output == "\e[1mimportant\e[0m\n\e[2mnot so much\e[0m\n"

end
end
end
# SPDX-License-Identifier: Apache-2.0

0 comments on commit 19c1347

Please sign in to comment.