Sha256: 0b0b6ea587c766098ec439d05ddae1dd6b741af20687bf61fd9c6c835046b797

Contents?: true

Size: 758 Bytes

Versions: 13

Compression:

Stored size: 758 Bytes

Contents

# -*- rspec -*-

BEGIN {
	require 'pathname'
	basedir = Pathname( __FILE__ ).dirname.parent.parent.parent
	$LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
}

require 'tempfile'
require 'rspec'
require 'spec/lib/helpers'
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

	before( :each ) do
		@formatter = described_class.new
	end

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

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
loggability-0.7.0 spec/loggability/formatter/color_spec.rb
loggability-0.6.1 spec/loggability/formatter/color_spec.rb
loggability-0.6.0 spec/loggability/formatter/color_spec.rb
loggability-0.5.0 spec/loggability/formatter/color_spec.rb
loggability-0.4.0 spec/loggability/formatter/color_spec.rb
loggability-0.3.0 spec/loggability/formatter/color_spec.rb
loggability-0.2.3 spec/loggability/formatter/color_spec.rb
loggability-0.2.2 spec/loggability/formatter/color_spec.rb
loggability-0.2.1 spec/loggability/formatter/color_spec.rb
loggability-0.2.0 spec/loggability/formatter/color_spec.rb
loggability-0.1.0 spec/loggability/formatter/color_spec.rb
loggability-0.0.2 spec/loggability/formatter/color_spec.rb
loggability-0.0.1 spec/loggability/formatter/color_spec.rb