Sha256: b0a1b634c204b18e2dfe95ee50d6e04443b9d0fe0c5e6b1c3b9bae8e958c0972

Contents?: true

Size: 704 Bytes

Versions: 56

Compression:

Stored size: 704 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

56 entries across 56 versions & 1 rubygems

Version Path
fedux_org-stdlib-0.11.18 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.17 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.16 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.15 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.14 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.12 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.11 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.9 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.8 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.7 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.6 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.5 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.4 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.3 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.2 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.1 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.11.0 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.10.9 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.10.8 spec/colors/html_color_spec.rb
fedux_org-stdlib-0.10.7 spec/colors/html_color_spec.rb