Sha256: 296a0fa017d7ea7dce1c3a0fc3dded98d3e2191ec81b989c31412281fbd7416c
Contents?: true
Size: 1.5 KB
Versions: 1
Compression:
Stored size: 1.5 KB
Contents
require 'spec_helper' describe LoGspot do let(:filename) { File.expand_path('../../tmp/spec.log', __FILE__) } before do FileUtils.rm(filename) end let(:tag_format) { '' } let(:logger) { LoGspot.new(filename, tag_format: tag_format) } let(:read) { -> { File.read(filename) } } describe '#write' do it 'should output properly' do logger.info('test') expect(read.()).to eq "test\n" end end describe '#value' do it 'should output properly' do logger.value(:info, test: 'test') expect(read.()).to eq "test: test\n" end end describe '#tagged' do it 'should output properly' do logger.tagged('tag') do logger.info('test') end expect(read.()).to eq "tagtest\n" end end describe '#untagged' do it 'should output properly' do logger.tagged('tag') do logger.tagged('tag2') do logger.untagged do logger.info('test') end end end expect(read.()).to eq "tagtest\n" end end describe '#top' do let(:tag_format) { 'a' } it 'should output properly' do logger.tagged('tag') do logger.top do logger.info('test') end end expect(read.()).to eq "atest\n" end end describe '#raw' do let(:tag_format) { 'a' } it 'should output properly' do logger.tagged('tag') do logger.raw do logger.info('test') end end expect(read.()).to eq "test\n" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
logspot-0.5.0 | spec/logspot_spec.rb |