Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

rspec log to console

# output to go into the log file (i.e logs/test.log)
Rails.logger.debug variable.inspect
Rails.logger.debug variable.to_yaml

# output in the console
require 'pp'

it 'does something'
	thing = Factory(:something)
    pp thing
end

# or
put s thing.to_yaml
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #rspec #log #console
ADD COMMENT
Topic
Name
5+8 =