Skip to content

Commit

Permalink
Add spec to confirm that ansi codes are preserved in reference to issue
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Sep 22, 2017
1 parent 2564023 commit 3973cc8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/unit/run_spec.rb
Expand Up @@ -117,4 +117,14 @@
expect(output).to eq("hello 1\nhello 2\nhello 3\n")
expect(error).to eq('')
end

it "preserves ANSI codes" do
output = StringIO.new
command = TTY::Command.new(output: output, printer: :quiet)

out, _ = command.run :echo, "\e[35mhello\e[0m"

expect(out).to eq("\e[35mhello\e[0m\n")
expect(output.string).to eq("\e[35mhello\e[0m\n")
end
end

0 comments on commit 3973cc8

Please sign in to comment.