Sha256: b8dab8d9eaf5f2592c0a22fa2e4ef64814f16b54f0514dd641f03837c668a593
Contents?: true
Size: 792 Bytes
Versions: 2
Compression:
Stored size: 792 Bytes
Contents
require 'spec/helper' describe 'Informer' do before(:each) do @out = [] def @out.puts(*args) push(*args) end @inform = Ramaze::Informer.new(@out) @inform.colorize = false end def format(tag, string) "[#{@inform.timestamp}] #{tag.to_s.upcase.ljust(5)} #{string}" end it 'info' do @inform.info('Some Info') @out.first.should == format(:info, 'Some Info') end it 'debug' do arr = [:some, :stuff] @inform.debug(arr) @out.first.should == format(:debug, arr.inspect) end it 'warn' do @inform.warn('More things') @out.first.should == format(:warn, 'More things') end it 'error' do begin raise('Stuff') rescue => ex end @inform.error(ex) @out.first.should == format(:error, ex.inspect) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ramaze-0.1.0 | spec/ramaze/inform/informer.rb |
ramaze-0.1.1 | spec/ramaze/inform/informer.rb |