Sha256: 0301f2131afaed75ae6cfa0244b9fa1a85f8b1f6185e126fd0504e866f04d028

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

require 'spec_helper'

describe Differ::Format::Color do
  it 'should format inserts well' do
    @expected = "\033[32mSAMPLE\033[0m"
    expect(Differ::Format::Color.call(Differ::Change.new(:insert => 'SAMPLE'))).to eq(@expected)
  end

  it 'should format deletes well' do
    @expected = "\033[31mSAMPLE\033[0m"
    expect(Differ::Format::Color.call(Differ::Change.new(:delete => 'SAMPLE'))).to eq(@expected)
  end

  it 'should format changes well' do
    @expected = "\033[31mTHEN\033[0m\033[32mNOW\033[0m"
    expect(Differ::Format::Color.call(Differ::Change.new(:delete => 'THEN', :insert => 'NOW'))).to eq(@expected)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ninja-differ-1.0.0 spec/differ/format/color_spec.rb