Sha256: 6c133e2e60fa62a71000b6bda43f2ac01b353d39c2cf2575e1626eb4fd4bbe61

Contents?: true

Size: 708 Bytes

Versions: 64

Compression:

Stored size: 708 Bytes

Contents

# encoding: utf-8
require 'spec_helper'
require 'fedux_org_stdlib/colors/html_color'

RSpec.describe FeduxOrgStdlib::Colors::HtmlColor do
  context '#valid?' do

    it 'suceeds if string is valid html color' do
      expect(FeduxOrgStdlib::Colors::HtmlColor.new('#11aa11')).to be_valid
    end

    it 'fails if color does not start with #' do
      expect(FeduxOrgStdlib::Colors::HtmlColor.new('111111')).not_to be_valid
    end

    it 'fails if length is invalid' do
      expect(FeduxOrgStdlib::Colors::HtmlColor.new('#111111111')).not_to be_valid
    end

    it 'fails if no hex number is given' do
      expect(FeduxOrgStdlib::Colors::HtmlColor.new('#ZZAAZZ')).not_to be_valid
    end
    
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
fedux_org-stdlib-0.7.21 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.20 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.19 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.18 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.17 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.16 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.15 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.14 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.12 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.11 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.10 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.8 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.7 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.6 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.5 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.4 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.3 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.2 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.1 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.7.0 spec/colors/html_color_spec.rb