Sha256: 92448efd4ed0e2a6e40326e5b11289aec355e00dca7309ea53788690af82854a

Contents?: true

Size: 669 Bytes

Versions: 2

Compression:

Stored size: 669 Bytes

Contents

# -*- encoding : utf-8 -*-
require 'megingiard/text_color_sequence'

describe Megingiard::TextColorSequence do
  subject { Megingiard::TextColorSequence }
  let(:color_code) { double }
  let(:name) { double }
  let(:ansi_code) { double }

  describe 'initialize' do
    it 'should create the ANSI escape sequence with the according code' do
      expect(Megingiard::ANSI_COLORS).to receive(:fetch)
        .with(name)
        .and_return(color_code)
      expect(color_code).to receive(:+)
        .with(30)
        .and_return(ansi_code)
      expect(Megingiard::AnsiEscapeSequence).to receive(:new)
        .with(ansi_code)

      subject.new(name)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
megingiard-0.1.0 spec/unit/text_color_sequence/initialize_spec.rb
megingiard-0.0.1 spec/unit/text_color_sequence/initialize_spec.rb