Sha256: 3bf132ad093d346c493ad494bfd3fe07a571b1cb140a9a46b268e0b317880e24
Contents?: true
Size: 766 Bytes
Versions: 36
Compression:
Stored size: 766 Bytes
Contents
require 'logstash-logger' describe LogStashLogger::Device::Stdout do let(:stdout) { $stdout } it "writes to $stdout" do expect(subject.to_io).to eq(stdout) expect(stdout).to receive(:write).once subject.write("test") end it "ignores #close" do expect(stdout).not_to receive(:close) subject.close end context "when the default $stdout has been overridden" do before { $stdout = StringIO.new } after { $stdout = STDOUT } let(:injected_stdout) { STDOUT } subject { described_class.new(io: injected_stdout) } it "accepts an injectable reference to stdout" do expect(subject.to_io).to eq(injected_stdout) expect(injected_stdout).to receive(:write).once subject.write("test") end end end
Version data entries
36 entries across 36 versions & 3 rubygems