Sha256: 9c90e0cf789350689ae1bf6e1aa0f4b80ba41de8377bf5bb0428994db97d5587
Contents?: true
Size: 833 Bytes
Versions: 11
Compression:
Stored size: 833 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' require 'zizia/streams/formatted_message_stream' describe Zizia::FormattedMessageStream do subject(:stream) { described_class.new(stream: fake_stream) } let(:fake_stream) { [] } it_behaves_like 'a Zizia::MessageStream' describe '#stream' do subject(:stream) { described_class.new } it 'is STDOUT by default' do expect(stream.stream).to eq STDOUT end end describe '#<<' do it 'appends newlines by default' do expect { stream << 'moomin' } .to change { fake_stream } .to contain_exactly("moomin\n") end it 'uses other % formatters' do stream.formatter = "!!!%s!!!" expect { stream << 'moomin' } .to change { fake_stream } .to contain_exactly('!!!moomin!!!') end end end
Version data entries
11 entries across 11 versions & 1 rubygems