colorable 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/colorable/color.rb +5 -1
- data/lib/colorable/color_space.rb +2 -2
- data/lib/colorable/version.rb +1 -1
- data/spec/color_spec.rb +17 -0
- 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: 8551829488f48f304ed2f67f7b3557805257249b
|
4
|
+
data.tar.gz: e7954149790ea24ad68c0d2874be0c1002a6648a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b16f6cabc48e8b27d57b3da0f968c68520e198dd83078646d2c49056fc55660a9a6ba9eb8ea99babbbf3f951407cb93b859aa67b5d661014c0871eeed901be35
|
7
|
+
data.tar.gz: 1aa34b017811d2e9428f4fa36e1b0ce8c468eb9e824650db27db4de37b8185cbfd9ff1a31ad9b7b07c871e3538b75bc8c3ae3a6c8241047529db1f0ffd88ab47
|
data/lib/colorable/color.rb
CHANGED
data/lib/colorable/version.rb
CHANGED
data/spec/color_spec.rb
CHANGED
@@ -283,4 +283,21 @@ describe Color do
|
|
283
283
|
Color.new(:black).info.should eql info
|
284
284
|
end
|
285
285
|
end
|
286
|
+
|
287
|
+
describe "#<=>" do
|
288
|
+
context "same colornames are same object" do
|
289
|
+
it { Color.new('Green').should == Color.new('Green') }
|
290
|
+
end
|
291
|
+
|
292
|
+
context "different colornames are different object even if its RGB are same" do
|
293
|
+
subject { Color.new('Green') }
|
294
|
+
it { should_not == Color.new('Lime') }
|
295
|
+
its(:rgb) { should == Color.new('Lime').rgb }
|
296
|
+
end
|
297
|
+
|
298
|
+
context "no name object compare by its RGB value" do
|
299
|
+
subject { Color.new [0, 1, 2] }
|
300
|
+
it { should_not == Color.new([0, 1, 3]) }
|
301
|
+
end
|
302
|
+
end
|
286
303
|
end
|