Sha256: 3c69356cbbdf2b0410dff701c8ba289bf38602a45ed7f829a4b8b1c515a66a42

Contents?: true

Size: 611 Bytes

Versions: 1

Compression:

Stored size: 611 Bytes

Contents

require 'spec_helper'
require 'rubyXL/convenience_methods/color'

describe RubyXL::RgbColor do
  describe '.to_s' do
    it 'should properly translate RGB color to string' do
      rgb_color = RubyXL::RgbColor.new

      rgb_color.r = 1
      rgb_color.g = 2
      rgb_color.b = 255

      expect(rgb_color.to_s).to eq('0102ff')
    end

    it 'should properly translate RGB color with alpha value to string' do
      rgb_color = RubyXL::RgbColor.new

      rgb_color.r = 11
      rgb_color.g = 22
      rgb_color.b = 33
      rgb_color.a = 255

      expect(rgb_color.to_s).to eq('0b1621ff')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubyXL-3.4.24 spec/lib/rgb_color_spec.rb