Sha256: 9b863a1a30a8137b5682d0525dc59ec840243eec3bd100c826817b7f71e4e0b3

Contents?: true

Size: 500 Bytes

Versions: 2

Compression:

Stored size: 500 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

RSpec.describe Pastel::Color, '.code' do
  let(:string) { "This is a \e[1m\e[34mbold blue text\e[0m" }

  subject(:color) { described_class.new(enabled: true) }

  it 'finds single code' do
    expect(color.code(:black)).to eq(["\e[30m"])
  end

  it 'finds more than one code' do
    expect(color.code(:black, :green)).to eq(["\e[30m", "\e[32m"])
  end

  it "doesn't find code" do
    expect { color.code(:unkown) }.to raise_error(ArgumentError)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pastel-0.2.1 spec/unit/color/code_spec.rb
pastel-0.2.0 spec/unit/color/code_spec.rb