Sha256: 4f22b9a12d7e65adee1137725da4c5ff3b9c59c88bd1157ab6cfe4f9754db82c

Contents?: true

Size: 551 Bytes

Versions: 7

Compression:

Stored size: 551 Bytes

Contents

# -*- ruby -*-
# vim: set nosta noet ts=4 sw=4:
# frozen_string_literal: true

require_relative '../../helpers'

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

7 entries across 7 versions & 1 rubygems

Version Path
loggability-0.18.2 spec/loggability/formatter/color_spec.rb
loggability-0.18.1 spec/loggability/formatter/color_spec.rb
loggability-0.18.0 spec/loggability/formatter/color_spec.rb
loggability-0.17.0 spec/loggability/formatter/color_spec.rb
loggability-0.16.0 spec/loggability/formatter/color_spec.rb
loggability-0.15.1 spec/loggability/formatter/color_spec.rb
loggability-0.15.0.pre20190714094638 spec/loggability/formatter/color_spec.rb