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.6.54 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.53 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.52 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.51 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.50 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.48 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.47 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.46 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.45 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.44 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.43 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.40 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.39 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.38 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.37 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.34 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.33 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.32 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.31 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.6.30 spec/colors/html_color_spec.rb