Sha256: 194dac39ac9dfb2e6ad124fe0f9bcb5dd4c1eea55b86353ab3e2830e114043e5

Contents?: true

Size: 551 Bytes

Versions: 1

Compression:

Stored size: 551 Bytes

Contents

require 'spec_helper'

describe Differ::Format::Patch do
  it 'should format inserts well' do
    @expected = "\033[32m+ SAMPLE\033[0m"
    expect(Differ::Format::Patch.format(+'SAMPLE')).to eq(@expected)
  end

  it 'should format deletes well' do
    @expected = "\033[31m- SAMPLE\033[0m"
    expect(Differ::Format::Patch.format(-'SAMPLE')).to eq(@expected)
  end

  it 'should format changes well' do
    @expected = "\033[31m- THEN\033[0m\n\033[32m+ NOW\033[0m"
    expect(Differ::Format::Patch.format('THEN' >> '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/patch_spec.rb