Sha256: ba1700e09794cb3b200a5c03b80bab5b7f4029b9426a4b7d8c81208767a1f3e0

Contents?: true

Size: 592 Bytes

Versions: 11

Compression:

Stored size: 592 Bytes

Contents



# -*- coding: utf-8 -*-
require 'spec_helper'

require 'stringio'

describe Tengine::Core::IoToLogger do

  context "redirect from io to logger" do
    before do
      @io = StringIO.new
      @logger = Logger.new(@io)
      @logger.level = Logger::INFO
    end
    subject{ Tengine::Core::IoToLogger.new(@logger) }
    it "should provide puts method" do
      subject.puts("foo")
      @io.rewind
      @io.readlines.should == ["foo\n"]
    end
    it "should provide write method" do
      subject.write("foo")
      @io.rewind
      @io.readlines.should == ["foo\n"]
    end
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tengine_core-0.5.39 spec/tengine/core/io_to_logger_spec.rb
tengine_core-0.5.38 spec/tengine/core/io_to_logger_spec.rb
tengine_core-0.5.37 spec/tengine/core/io_to_logger_spec.rb
tengine_core-0.5.36 spec/tengine/core/io_to_logger_spec.rb
tengine_core-0.5.35 spec/tengine/core/io_to_logger_spec.rb
tengine_core-0.5.34 spec/tengine/core/io_to_logger_spec.rb
tengine_core-0.5.33 spec/tengine/core/io_to_logger_spec.rb
tengine_core-0.5.32 spec/tengine/core/io_to_logger_spec.rb
tengine_core-0.5.31 spec/tengine/core/io_to_logger_spec.rb
tengine_core-0.5.30 spec/tengine/core/io_to_logger_spec.rb
tengine_core-0.5.28 spec/tengine/core/io_to_logger_spec.rb