spec/beaker/logger_spec.rb in beaker-1.19.1 vs spec/beaker/logger_spec.rb in beaker-1.20.0

- old
+ new

@@ -70,17 +70,44 @@ my_io.should_receive( :puts ).with 'my string' colorized_logger.optionally_color "\e[00;30m", 'my string' end + context 'at trace log_level' do + subject( :trace_logger ) { Logger.new( my_io, + :log_level => 'trace', + :quiet => true, + :color => true ) + } + + its( :is_debug? ) { should be_true } + its( :is_trace? ) { should be_true } + its( :is_warn? ) { should be_true } + + context 'but print' do + before do + my_io.stub :puts + my_io.should_receive( :print ).at_least :twice + end + + it( 'warnings' ) { trace_logger.warn 'IMA WARNING!' } + it( 'successes' ) { trace_logger.success 'SUCCESS!' } + it( 'errors' ) { trace_logger.error 'ERROR!' } + it( 'host_output' ) { trace_logger.host_output 'ERROR!' } + it( 'debugs' ) { trace_logger.debug 'DEBUGGING!' } + it( 'traces' ) { trace_logger.trace 'TRACING!' } + end + end + context 'at verbose log_level' do subject( :verbose_logger ) { Logger.new( my_io, :log_level => 'verbose', :quiet => true, :color => true ) } + its( :is_trace? ) { should be_false } its( :is_debug? ) { should be_false } its( :is_verbose? ) { should be_true } its( :is_warn? ) { should be_true } context 'but print' do @@ -102,10 +129,11 @@ :log_level => 'debug', :quiet => true, :color => true ) } + its( :is_trace? ) { should be_false } its( :is_debug? ) { should be_true } its( :is_warn? ) { should be_true } context 'successfully print' do before do @@ -127,18 +155,20 @@ :quiet => true, :color => true ) } its( :is_debug? ) { should be_false } + its( :is_trace? ) { should be_false } context 'skip' do before do my_io.should_not_receive :puts my_io.should_not_receive :print end it( 'debugs' ) { info_logger.debug 'NOT DEBUGGING!' } + it( 'traces' ) { info_logger.debug 'NOT TRACING!' } end context 'but print' do before do