colcolor 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/colcolor.rb +1 -1
- data/lib/colcolor/version.rb +1 -1
- data/spec/colcolor_spec.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e0f1528e02ce7d5dc2f43daf6d4fa700dd656c2
|
4
|
+
data.tar.gz: 1a546ff89d31b8656046f4cbe0fbd2c41163e3f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfbea0605bd114ac7d298243634977a547029093169236ce8dd3bf3764c02cce1fed224b3c3825c7c5cc268999157d0ff81ad90346cdeec0a5677e1702d70d90
|
7
|
+
data.tar.gz: 05d54f0949d93d39a1791466327a83d0ed1ebc94ffcee825cde620e6d2d33e0f213db3540a53de8ff1524f3e5937ab24f77f2c53bbf285411de89bca4762654c
|
data/lib/colcolor.rb
CHANGED
data/lib/colcolor/version.rb
CHANGED
data/spec/colcolor_spec.rb
CHANGED
@@ -27,21 +27,21 @@ describe Colcolor do
|
|
27
27
|
context "two or more color attributes to a word" do
|
28
28
|
it "colors a word with two attrs" do
|
29
29
|
str = "Charlie is great!"
|
30
|
-
expect = "\e[32mCharlie\e[0m is
|
30
|
+
expect = "\e[32mCharlie\e[0m is \e[31m\e[4mgreat!\e[0m"
|
31
31
|
color_set = [:green, nil, :red_underline]
|
32
32
|
expect(str.colco(*color_set)).to eq expect
|
33
33
|
end
|
34
34
|
|
35
35
|
it "colors a word with three attrs" do
|
36
36
|
str = "Charlie is great!"
|
37
|
-
expect = "\e[32mCharlie\e[0m is
|
37
|
+
expect = "\e[32mCharlie\e[0m is \e[31m\e[43m\e[4mgreat!\e[0m"
|
38
38
|
color_set = [:green, nil, :red_yellow_underline]
|
39
39
|
expect(str.colco(*color_set)).to eq expect
|
40
40
|
end
|
41
41
|
|
42
42
|
it "colors a word with color attrs but no foreground" do
|
43
43
|
str = "Charlie is great!"
|
44
|
-
expect = "\e[32mCharlie\e[0m is
|
44
|
+
expect = "\e[32mCharlie\e[0m is \e[43m\e[4mgreat!\e[0m"
|
45
45
|
color_set = [:green, nil, :_yellow_underline]
|
46
46
|
expect(str.colco(*color_set)).to eq expect
|
47
47
|
end
|
@@ -49,13 +49,13 @@ describe Colcolor do
|
|
49
49
|
|
50
50
|
context "short colors" do
|
51
51
|
it "colors a word white for missing color" do
|
52
|
-
expect = "\e[32mGeorge\e[0m \e[33m18\e[0m guitarist
|
52
|
+
expect = "\e[32mGeorge\e[0m \e[33m18\e[0m guitarist"
|
53
53
|
color_set = [:green, :yellow]
|
54
54
|
expect(@str.colco(*color_set)).to eq expect
|
55
55
|
end
|
56
56
|
|
57
57
|
it "colors a word white at intermidiate" do
|
58
|
-
expect = "\e[32mGeorge\e[0m 18
|
58
|
+
expect = "\e[32mGeorge\e[0m 18 \e[31mguitarist\e[0m"
|
59
59
|
color_set = [:green, nil, :red]
|
60
60
|
expect(@str.colco(*color_set)).to eq expect
|
61
61
|
end
|