Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix colorize specs on dumb terminal #8673

Merged
merged 2 commits into from
Jan 11, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions spec/std/colorize_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ end
private class ColorizeToS
def to_s(io)
io << "hello"
io << "world".colorize.blue
io << ::colorize("world").toggle(true).blue
straight-shoota marked this conversation as resolved.
Show resolved Hide resolved
io << "bye"
end
end
Expand Down Expand Up @@ -133,7 +133,7 @@ describe "colorize" do
io = IO::Memory.new
with_color_wrap.red.surround(io) do
io << "hello"
with_color.green.surround(io) do
with_color_wrap.green.surround(io) do
io << "world"
end
io << "bye"
Expand Down Expand Up @@ -178,7 +178,7 @@ describe "colorize" do
end

it "colorizes with to_s" do
ColorizeToS.new.colorize.red.to_s.should eq("\e[31mhello\e[0;34mworld\e[0;31mbye\e[0m")
colorize(ColorizeToS.new).red.to_s.should eq("\e[31mhello\e[0;34mworld\e[0;31mbye\e[0m")
end

it "toggles off" do
Expand Down