Sha256: cf02c6e9b3a15c4480bdfeeafbf3106ea43c38bc5180cd1f3460a43334e65d4b

Contents?: true

Size: 502 Bytes

Versions: 4

Compression:

Stored size: 502 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

RSpec.describe Pastel::Color, '.valid?' do
  it "detects valid colors" do
    color = described_class.new
    expect(color.valid?(:red, :on_green, :bold)).to eq(true)
  end

  it "detects valid color aliases" do
    color = described_class.new
    color.alias_color(:funky, :red)
    expect(color.valid?(:funky)).to eq(true)
  end

  it "detects invalid color" do
    color = described_class.new
    expect(color.valid?(:red, :unknown)).to eq(false)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pastel-0.5.3 spec/unit/color/valid_spec.rb
pastel-0.5.2 spec/unit/color/valid_spec.rb
pastel-0.5.1 spec/unit/color/valid_spec.rb
pastel-0.5.0 spec/unit/color/valid_spec.rb