diff --git a/spec/unit/color_spec.rb b/spec/unit/color_spec.rb index d27cdb3..69972a2 100644 --- a/spec/unit/color_spec.rb +++ b/spec/unit/color_spec.rb @@ -37,7 +37,7 @@ module Rainbow specify { expect(subject.b).to eq(112) } end - context "when single string given" do + context "when single hexadecimal string given" do let(:values) { ['#deadcc'] } it { should be_instance_of(Color::RGB) } @@ -48,6 +48,14 @@ module Rainbow specify { expect(subject.b).to eq(204) } end + context "when single non hexadecimal string given" do + let(:values) { ['green'] } + + it 'raises ArgumentError' do + expect { subject }.to raise_error(ArgumentError) + end + end + context "when 2 elements" do let(:values) { [1, 2] }