Sha256: eb1272f24c25a50facefc97512c129d5edd722e78e45fb0b1bf77bb3f45c20b2

Contents?: true

Size: 500 Bytes

Versions: 11

Compression:

Stored size: 500 Bytes

Contents

# encoding: utf-8

RSpec.describe Pastel::Color, '#lookup' do
  it "looksup colors" do
    color = described_class.new(enabled: true)
    expect(color.lookup(:red, :on_green, :bold)).to eq("\e[31;42;1m")
  end

  it "caches color lookups" do
    color = described_class.new(enabled: true)
    allow(color).to receive(:code).and_return([31])
    color.lookup(:red, :on_green)
    color.lookup(:red, :on_green)
    color.lookup(:red, :on_green)
    expect(color).to have_received(:code).once
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
pokedex-terminal-0.2.8 vendor/bundle/ruby/2.7.0/gems/pastel-0.7.3/spec/unit/color/lookup_spec.rb
pokedex-terminal-0.2.7 vendor/bundle/ruby/2.7.0/gems/pastel-0.7.3/spec/unit/color/lookup_spec.rb
pokedex-terminal-0.2.6 vendor/bundle/ruby/2.7.0/gems/pastel-0.7.3/spec/unit/color/lookup_spec.rb
pokedex-terminal-0.2.5 vendor/bundle/ruby/2.7.0/gems/pastel-0.7.3/spec/unit/color/lookup_spec.rb
pokedex-terminal-0.2.4 vendor/bundle/ruby/2.7.0/gems/pastel-0.7.3/spec/unit/color/lookup_spec.rb
pastel-0.7.3 spec/unit/color/lookup_spec.rb
pastel-0.7.2 spec/unit/color/lookup_spec.rb
pastel-0.7.1 spec/unit/color/lookup_spec.rb
pastel-0.7.0 spec/unit/color/lookup_spec.rb
pastel-0.6.1 spec/unit/color/lookup_spec.rb
pastel-0.6.0 spec/unit/color/lookup_spec.rb