Sha256: 921d1f822132af2d7cf28639cafc7452c2d1e76a7824069f0e1e7207ae8e9e18

Contents?: true

Size: 603 Bytes

Versions: 6

Compression:

Stored size: 603 Bytes

Contents

# -*- rspec -*-
#encoding: utf-8

require_relative '../../helpers'

require 'tempfile'
require 'rspec'

require 'loggability/logger'
require 'loggability/formatter'
require 'loggability/formatter/color'


describe Loggability::Formatter::Color do

	before( :all ) do
		@original_term = ENV['TERM']
		ENV['TERM'] = 'xterm-color'
	end

	after( :all ) do
		ENV['TERM'] = @original_term
	end


	let( :formatter ) { described_class.new }


	it "formats messages with ANSI color" do
		expect(
			formatter.call( 'INFO', Time.at(1336286481), nil, "Foom." )
		).to include( "-- \e[37mFoom.\e[0m\n" )
	end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
loggability-0.14.0 spec/loggability/formatter/color_spec.rb
loggability-0.13.0 spec/loggability/formatter/color_spec.rb
loggability-0.12.0 spec/loggability/formatter/color_spec.rb
loggability-0.12.0.pre20161214121603 spec/loggability/formatter/color_spec.rb
loggability-0.12.0.pre20161212115530 spec/loggability/formatter/color_spec.rb
loggability-0.11.0 spec/loggability/formatter/color_spec.rb