diff options
author | Abinoam P. Marques Jr <abinoam@gmail.com> | 2017-06-24 10:26:13 -0300 |
---|---|---|
committer | Abinoam P. Marques Jr <abinoam@gmail.com> | 2017-06-24 10:28:25 -0300 |
commit | 3e45ed845f99480c96a23240b26110a89223f80d (patch) | |
tree | 819bdd2ee453036396af667cc01023d0df44e00f | |
parent | 9cf17c979e0b61afe54cb190cf4a67d94cf785f8 (diff) | |
download | highline-3e45ed845f99480c96a23240b26110a89223f80d.tar.gz |
Add test for instance having same use_color method of class
-rwxr-xr-x | test/test_highline.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_highline.rb b/test/test_highline.rb index 930379e..7736690 100755 --- a/test/test_highline.rb +++ b/test/test_highline.rb @@ -509,10 +509,21 @@ class TestHighLine < Minitest::Test def test_color_setting_per_instance # It can set coloring at HighLine class + cli_input = StringIO.new + cli_output = StringIO.new + old_setting = HighLine.use_color? + cli = HighLine.new(cli_input, cli_output) + HighLine.use_color = true + cli.use_color = true + @terminal.say("This should be <%= color('cyan', CYAN) %>!") assert_equal("This should be \e[36mcyan\e[0m!\n", @output.string) + + cli.say("This should be <%= color('cyan', CYAN) %>!") + assert_equal("This should be \e[36mcyan\e[0m!\n", cli_output.string) + HighLine.use_color = old_setting end |