spec/beaker/logger_spec.rb in beaker-2.18.3 vs spec/beaker/logger_spec.rb in beaker-2.19.0
- old
+ new
@@ -201,8 +201,47 @@
it( 'successes' ) { info_logger.success 'SUCCESS!' }
it( 'notifications' ) { info_logger.notify 'NOTFIY!' }
it( 'errors' ) { info_logger.error 'ERROR!' }
end
end
+
+ context 'SUT output logging' do
+
+ context 'host output logging' do
+ subject( :host_output ) { Logger.new( my_io,
+ :log_level => :verbose,
+ :quiet => true,
+ :color => true )}
+
+ it 'should output GREY when @color is set to true' do
+ colorized_logger = host_output
+
+ expect( my_io ).to receive( :print ).with "\e[01;30m"
+ expect( my_io ).to receive( :print )
+ expect( my_io ).to receive( :puts ).with 'my string'
+
+ colorized_logger.optionally_color "\e[01;30m", 'my string'
+ end
+
+ end
+
+ context 'color host output' do
+ subject( :color_host_output ) { Logger.new( my_io,
+ :log_level => :verbose,
+ :quiet => true,
+ :color => true )}
+
+ it 'colors host_output' do
+ colorized_logger = color_host_output
+
+ expect( my_io ).to receive( :print ).with ""
+ expect( my_io ).to receive( :puts ).with 'my string'
+
+ colorized_logger.optionally_color "", 'my string'
+ end
+
+ end
+ end
+
end
end
end