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